#include using namespace std; typedef pair pii; typedef long long ll; const int N = 2000008, MOD = 998244353, INF = 0x3f3f3f3f; ll res; int n, m, cnt, w[N], p[N]; int main() { cin >> n; for (int i = 1; i < n + 1; i++) scanf("%d", w + i), p[i] = w[i]; // n = 100; // for (int i = 1; i < n + 1; i++) w[i] = i - 1; // random_shuffle(w + 1, w + n + 1); // for (int i = 1; i < n + 1; i++) p[i] = w[i]; string ans; for (int i = n; i; i--) { if (w[i] == i - 1) continue; int t; for (int j = 1; j < n; j++) if (w[j] == i - 1) t = j; int now = t, len = i - t, c = n - (len + now - 1) % n, pos = t; while (now != 1) ans += 'R', now--; while (len--) ans += "SR", swap(w[pos], w[pos + 1]), pos++; while (c--) ans += 'R'; } for (auto u : ans) { if (u == 'S') swap(p[1], p[2]); else { int t = p[1]; for (int i = 1; i < n; i++) p[i] = p[i + 1]; p[n] = t; } // for (int i = 1; i < n + 1; i++) printf("%d ", p[i]); // puts(""); } assert(ans.size() <= 20000); for (int i = 2; i < n + 1; i++) assert(p[i] > p[i - 1]); cout << ans << endl; return 0; }