#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=144499999999994; ll mod=1000000007; int main(){ ll n,k; cin >> n >> k; vector>p(k); for (ll i = 0; i < k; i++) { cin >> p[i].first >> p[i].second; p[i].first--; } sort(p.begin(),p.end()); string s; for (ll i = 0; i < n; i++) { s.push_back('N'); } ll now=0; ll r,b,g; for (ll i = 0; i < n; i++) { if (i%3==0) { r=1,b=1,g=1; } if (p[now].first==i) { if (p[now].second=='R') { if (r==1) { s[i]='R'; r=0; now+=1; continue; } }else if (p[now].second=='G') { if (g==1) { s[i]='G'; g=0; now+=1; continue; } }else{ if (b==1) { s[i]='B'; b=0; now+=1; continue; } } if (r>0) { s[i]='R'; r=0; }else if (g>0) { s[i]='G'; g=0; }else{ s[i]='B'; b=0; } now+=1; }else{ if (r>0) { s[i]='R'; r=0; }else if (g>0) { s[i]='G'; g=0; }else{ s[i]='B'; b=0; } } } cout << s << endl; }