#include #include using namespace std; typedef pair P; int main() { int n, k; cin >> n >> k; P p[200005]; for (int i = 0; i < k; i++) { cin >> p[i].first >> p[i].second; } sort(p, p + k); int d[3]{0}; string ans; for (int i = 0; i < k; i++) { while (d[(int)p[i].second % 3] < (p[i].first + 2) / 3) { ans += p[i].second; d[(int)p[i].second % 3]++; } } while ((int)ans.size() < n) { ans += 'R'; } cout << ans << endl; }