# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1") # from bisect import * # from collections import * # from heapq import * # from itertools import * # from math import * # from datetime import * # from decimal import * # PyPyだと遅い # from string import ascii_lowercase, ascii_uppercase # import numpy as np import sys import os # sys.setrecursionlimit(10**6) # PyPyだと遅い INF = 10**18 MOD = 998244353 # MOD = 10**9 + 7 isTest = os.path.exists("input.txt") File = open("input.txt", "r") if isTest else sys.stdin def input(): return File.readline()[:-1] # /////////////////////////////////////////////////////////////////////////// if isTest: P = list(map(int, input().split())) outFile = open("output.txt", "w") # 盤面を動かす関数 def moveGrid(grid): for i in range(1, 60): for j in range(25): grid[i - 1][j] = grid[i][j] if i == 59: grid[i][j] = (0, 0, 0) # 敵までの距離を求める関数 def distance(grid, now): for i in range(60): if grid[i][now][0]: return i return -1 me = 12 move = ["S", "R", "L"] score = 0 turn = 0 total_power = 0 grid = [[(0, 0, 0) for _ in range(25)] for _ in range(60)] while True: n = int(input()) if n == -1: break enemy = [list(map(int, input().split())) for _ in range(n)] moveGrid(grid) for h, p, x in enemy: grid[59][x] = (h, p, h) ans = 0 dist = distance(grid, me) if dist != -1: if grid[dist][me][0] > dist * (total_power // 100 + 1): if me == 0: ans = 1 elif me == 24: ans = -1 else: distL = distance(grid, me - 1) - 1 distR = distance(grid, me + 1) - 1 if grid[distL][me - 1][0] > distL * (total_power // 100 + 1): ans = 1 else: ans = -1 else: grid[dist][me] = ( grid[dist][me][0] - (total_power // 100 + 1), grid[dist][me][1], grid[dist][me][2], ) if grid[dist][me][0] <= 0: score += grid[dist][me][2] total_power += grid[dist][me][1] grid[dist][me] = (0, 0, 0) me = me + ans # print(me) if isTest: outFile.write(move[ans] + "\n") else: print(move[ans], flush=True) turn += 1 if turn == 1000: break if isTest: outFile.close()