#include using namespace std; using lint=long long; #define rep(i,n) for(int i=0;i>n; vectors(n); vectorcnt(3); rep(i,n){ char c; lint j; cin>>c>>j; j--; s[j]+=c; string t="BRG"; rep(k,3){ if(t[k]==c){ cnt[k]++; } } } rep(i,n)sort(all(s[i])); sort(all(s)); lint p=count(all(s),"GR"); lint q=count(all(s),"BG"); lint r=count(all(s),"BR"); if((p&&q)||(q&&r)||(r&&p)){ cout<<"YES"<>t; while(t--)solve(); }