#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; const ll MOD = 998244353; #include using namespace atcoder; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll n;cin>>n; vector P(n); rep(i,n)cin>>P[i]; ll now=0,cnt=0; while(cnt<=n){ if(P[now]>P[(now+1)%n] && !(P[now]==n-1 && P[(now+1)%n]==0)){ cout<<'S'; swap(P[now],P[(now+1)%n]); cnt=0; }else{ cout<<'R'; now=(now+n-1)%n; cnt++; } } ll c; rep(i,n){ if(P[i]==0)c=i; break; } rep(i,(c-now+n)%n){ cout<<'R'; } }