d={ "p":["r", "r"], "s":["k", "s"], "k":["k", "p"], "r":["p", "s"] } n={"0":[0], "1":[1], "-1":[0, 1]} input() pb={"p", "s"} for v in input().split(" "): pb={d[x][k] for x in pb for k in n[v]} print(pb)