from collections import deque import random import argparse parser = argparse.ArgumentParser() parser.add_argument('--local', action='store_true') args = parser.parse_args() if args.local: P = list(map(int, input().split())) D = [deque() for _ in range(25)] my_x = 12 my_lv = 1 my_p = 0 dir = ["S", "R", "L"] turn = 0 while turn<1000: N = int(input()) if N==-1: break HPX = [list(map(int, input().split())) for _ in range(N)] #敵を移動 for x in range(25): for i in range(len(D[x])): # y D[x][i][0] -= 1 if len(D[x])>0 and D[x][0][0]<0: D[x].popleft() #新たな敵 for h, p, x in HPX: D[x].append([59, h, p, h]) #自機の移動を決定 maxhp = 0 max_x = -1 for x in range(25): if len(D[x])==0: continue y, h, p, ini = D[x][0] #破壊可能か? trn = h//my_lv + (1 if h%my_lv else 0) sa = (x-my_x)%25 if sa==0: pass elif sa<=12: trn+=(sa-1) else: trn+=(sa-13) if y-trn<1: continue #破壊可能 #tmp = p/h tmp = ini/(trn) if maxhp12: d = -1 else: d = 0 else: sa = (max_x-my_x)%25 if sa==0: d = 0 elif sa<=12: d = 1 else: d = -1 #移動先に敵がいるか? nx = (my_x+d)%25 lp = 0 while lp<3 and len(D[nx])>0 and D[nx][0][0]<=1: #移動先に敵がいる if d==0: d = 1 if random.randint(0, 1) else -1 else: d = 0 nx = (my_x+d)%25 lp+=1 #自機を移動 print(dir[d], flush=True) my_x = (my_x+d)%25 #攻撃 if len(D[my_x])>0: y, h, p, ini = D[my_x][0] D[my_x][0][1] -= my_lv if D[my_x][0][1]<=0: my_p += p my_lv = 1 + my_p//100 D[my_x].popleft() turn += 1