#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n; cin >> n; vector p(n); for (int &x : p) cin >> x; auto finished = [&] () -> bool { for (int i = 0; i < n; i++) { if (p[i] != i) return false; } return true; }; vector ok(n, false); ok[0] = true; auto update = [&] () -> void { for (int i = 0; i < n; i++) { if (p[i] == 0) { for (int j = 1; j < n; j++) { int k = (i + j) % n; if (p[k] == j) ok[j] = true; else break; } break; } } }; update(); string ans; while (!finished()) { if (!ok[p[0]] && !ok[p[1]]) { ans += 'S'; swap(p[0], p[1]); update(); } ans += 'R'; rotate(p.begin(), p.begin() + 1, p.end()); } cout << ans << "\n"; return 0; }