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