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_perf = 0 next_w = randint(0, W-1) for w in range(W): is_first = True c_pow = 0 c_turn = 0 for h in range(H): hp, pow = board[h][w] if hp == -1: continue dist, d = min_dist(jiki_w, w) if not is_first: dist = 0 a_turn = h-dist-c_turn if a_turn <= 0: break if a_turn*level < hp: break if is_first: gekiha_turn = dist + -(-hp//level) else: gekiha_turn = c_turn + -(-hp//level) perf = pow/gekiha_turn if perf > next_perf: next_perf = perf next_w = w c_pow += pow c_turn = gekiha_turn dist, d = min_dist(jiki_w, next_w) if d==1 and board[0][(jiki_w+1)%W][0] == board[1][(jiki_w+1)%W][0] == -1: print("R") jiki_w += 1 elif d==2 and board[0][(jiki_w-1)%W][0] == board[1][(jiki_w-1)%W][0] == -1: print("L") jiki_w -= 1 else: if board[1][jiki_w][0] > level: if board[0][(jiki_w-1)%W][0] == board[1][(jiki_w-1)%W][0] == -1: print("L") jiki_w -= 1 elif board[0][(jiki_w+1)%W][0] == board[1][(jiki_w+1)%W][0] == -1: print("R") jiki_w += 1 else: print("S") 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