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