From a bag containing a yellow, a red, an orange, a pink and a green ball, two balls are selected one after the other with replacement. Draw a tree diagram and list the sample space.
S = {YY, YR, YO, YP, YG, RY, RR, RO, RP, RG, OY, OR, OO, OP, OG, PY, PR, PO, PP, PG, GY, GR, GO, GP, GG}