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