from collections import deque N = int(input()) P = deque(list(map(int,input().split()))) ans = [] for i in range(N-2,0,-1): ind = P.index(i) if P[(ind+1)%N]==i+1:continue while True: while P[0]!=i: a = P.popleft() P.append(a) ans.append("R") P[0],P[1] = P[1],P[0] ans.append("S") if P[2]==i+1:break if P!=list(range(N)): while P[0]!=0: a = P.popleft() P.append(a) ans.append("R") print("".join(ans))