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 x1 in range(25): if len(D[x1])==0: continue y1, h1, p1, ini1 = D[x1][0] #破壊可能か? trn1 = h1//my_lv + (1 if h1%my_lv else 0) sa1 = (x1-my_x)%25 if sa1==0: pass elif sa1<=12: trn1+=(sa1-1) else: trn1+=(sa1-13) if y1-trn1<1: continue #破壊可能 tmp = (p1)/(trn1) 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