#include using namespace std; using ll=long long; using ld=long double; using P=pair; using ps=pair; using V=vector; #define rep(i,n) for(int i=0;i> n >> q; V a(n,-1); rep(i,q){ int x; char c; cin >> x >> c; x--; if(c=='R') a[x]=0; if(c=='G') a[x]=1; if(c=='B') a[x]=2; } vector s(n+5,V(3)); rep(i,n){ bool f=(a[i]==-1); if(!f){ if(max({s[i][0],s[i][1],s[i][2]})<=s[i][a[i]]) f=true; } if(f){ bool bl=true; rep(j,3) if(s[i][j]