#include #include using namespace std; bool check(vector&p,int offset){ int n = p.size(); for(int i=0;i p[(i+offset+1)%n]) return false; } return true; } int main(){ int n;cin>>n; vectorp(n); for(int i=0;i>p[i]; int offset = 0; while(1){ if(check(p,offset)){ cout << endl; return 0; } if(p[offset%n] > p[(offset+1)%n] && p[offset%n] != n-1){ swap(p[offset%n] , p[(offset+1)%n]); cout << 'S'; } else { offset++; cout << 'R'; } } }