d={ "p":["r", "r"], "s":["k", "s"], "k":["k", "p"], "r":["p", "s"] } input() m=[int(s) for s in input().split(" ")] pb="p" for v, nr in enumerate(m): pb=d[pb][m[nr]] print(pb)