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 in m: pb=d[pb][v] print(pb)