#include // cout, endl, cin #include // string, to_string, stoi #include // vector #include // min, max, swap, sort, reverse, lower_bound, upper_bound #include // pair, make_pair #include // tuple, make_tuple #include // int64_t, int*_t #include // printf #include // map #include // queue, priority_queue #include // set #include // stack #include // deque #include // unordered_map #include // unordered_set #include // bitset #include // isupper, islower, isdigit, toupper, tolower #include //fixed,setprecision //#include //INT_MAX //#include //M_PI #include #include // 正規表現 #include #include //#include using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) constexpr int width = 25; // フィールドの幅 constexpr int height = 60; // フィールドの高さ constexpr int max_turn = 1000; // ゲームの最大ターン数 const char choice[3] = {'L', 'R', 'S'}; int masu[25][60]; int masu1[25][60]; int sx = 12; int power=0; int kogeki=1; int score=0; int sy=0; struct Data { int h; int p; int x; int y; Data(int h, int p, int x, int y) : h(h), p(p), x(x), y(y) {} }; bool compareByValue(const Data& a, const Data& b) { int valueA = a.y - std::abs(sx - a.x) - 1 - a.h; int valueB = b.y - std::abs(sx - b.x) - 1 - b.h; if (valueA != valueB) return valueA > valueB; else return std::abs(sx - a.x) < std::abs(sx - b.x); } int main() { #ifdef ONLINE_JUDGE #else //vectorP(25); //rep(i,25)cin>>P[i]; #endif vector data[25]; vector data_moto[25]; vectorlane(25,-1); //rep(i,25)data[i].emplace_back(0,0,0,59); for (int turn = 1; turn <= max_turn; turn++) { //cerr<<"#turn"<> n; if (n == -1) return 0; for (int i = 0; i < n; i++) { int h1, p1, x1; cin >> h1 >> p1 >> x1; data[x1].emplace_back(h1, p1, x1, 59+turn); data_moto[x1].emplace_back(h1, p1, x1, 59+turn); if(lane[x1]==-1)lane[x1]=0; } int min_i=-1; int sho=1000; int dai=0; int dai_power=0; //kogeki=1; rep(i,25){ if (lane[i]==-1)continue; if(lane[i]+1>data[i].size())continue; Data z=data[i][lane[i]]; if(z.h==0)continue; kogeki=1+(power/100); if(kogeki<=0)kogeki=1; //cerr<<__LINE__<<"---"<1&&sho>abs(sx-z.x)+evaluated_score&&z.y!=-1&&z.x!=-1&&z.h>0){ if(tmp>1&&sho>abs(sx-z.x)&&z.y-sy>1&&z.x!=-1&&z.h>0){ //if(tmp>1&&((kogeki<2&&dai=2&&sho>abs(sx-z.x)))&&z.y!=-1&&z.x!=-1&&z.h>0){ min_i=z.x; sho=abs(sx-z.x); dai=z.p; dai_power=z.h; //sho=abs(sx-z.x)+evaluated_score; //cerr<<" turn:"< min_i&&(data[(25+sx-1)%25].empty()||lane[(25+sx-1)%25]==-1||(lane[(25+sx-1)%25]+1<=data[(25+sx-1)%25].size()&&data[(25+sx-1)%25][lane[(25+sx-1)%25]].y-sy>=2)||lane[(25+sx-1)%25]+1>data[(25+sx-1)%25].size())) { r = 0;//L sx--; sx+=25; sx%=25; } else if (sx < min_i&&(data[(sx+1)%25].empty()||lane[(sx+1)%25]==-1||(lane[(sx+1)%25]+1<=data[(sx+1)%25].size()&&data[(sx+1)%25][lane[(sx+1)%25]].y-sy>=2)||lane[(sx+1)%25]+1>data[(sx+1)%25].size())) { r = 1;//R sx++; sx%=25; } else if(data[sx].empty()||lane[sx]==-1||(lane[sx]+1<=data[sx].size()&&data[sx][lane[sx]].y-sy>=2)||lane[sx]+1>data[sx].size()){ r = 2; }else if(sx>=1&&(data[sx-1].empty()||lane[sx-1]==-1||(lane[sx-1]+1<=data[sx-1].size()&&data[sx-1][lane[sx-1]].y-sy>=2)||lane[sx-1]+1>data[sx-1].size())){ r = 0;//L sx--; }else if(sx+1<25&&(data[sx+1].empty()||lane[sx+1]==-1||(lane[sx+1]+1<=data[sx+1].size()&&data[sx+1][lane[sx+1]].y-sy>=2))||lane[sx+1]+1>data[sx+1].size()){ r = 1;//R sx++; }else{ r=2; } char c = choice[r]; cout << c << endl; cout << "#" << c << " sx:" << sx <1+data[i][lane[i]].y)lane[i]++; } } //cerr<<__LINE__<<"---"<