from collections import deque from random import randint H = 60 W = 25 board = deque([[[-1, -1] for _ in range(W)] for _ in range(H)]) level = 1 power = 0 jiki_w = 12 def min_dist(w1, w2): if w1 == w2: return 0, 0 if w1 < w2: if w2-w1 <= 12: return w2-w1, 1 else: return 25-(w2-w1), 2 if w1 > w2: if w1-w2 <= 12: return w1-w2, 2 else: return 25-(w1-w2), 1 return -1, -1 for turn in range(1000): board.popleft() board.append([[-1, -1] for _ in range(W)]) N = int(input()) if N==-1: exit() for _ in range(N): h, p, x = map(int, input().split()) board[59][x] = [h, p] next_w_dif = 30 next_w = randint(0, W-1) for w in range(W): for h in range(H): hp, pow = board[h][w] if hp == -1: continue dist, d = min_dist(jiki_w, w) a_turn = h-dist if a_turn <= 0: continue if a_turn*level < hp: continue if dist < next_w_dif: next_w_dif = dist next_w = w dist, d = min_dist(jiki_w, next_w) if d==1 and board[0][(jiki_w+1)%W][0] == -1: print("R") jiki_w += 1 elif d==2 and board[0][(jiki_w-1)%W][0] == -1: print("L") jiki_w -= 1 else: print("S") jiki_w %= W for h in range(H): if board[h][jiki_w][0] == -1: continue board[h][jiki_w][0] -= level if board[h][jiki_w][0] <= 0: power += board[h][jiki_w][1] level = 1+power//100 board[h][jiki_w] = [-1, -1] break