#include using namespace std; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector a(n); for(auto &&v : a) cin >> v; auto check = [&](){ for(int i = 0; i < n; i++){ if((a[i] + 1) % n != a[(i + 1) % n]) return true; } return false; }; string ans; while(check()){ if(a[0] > a[1] && !(a[0] == n - 1 && a[1] == 0)){ ans += 'S'; swap(a[0], a[1]); } rotate(a.begin(), a.begin() + 1, a.end()); ans += 'R'; } while(a[0] != 0){ ans += 'R'; rotate(a.begin(), a.begin() + 1, a.end()); } cout << ans << '\n'; }