#include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000000 struct Ball{ char color,ncolor; int ncnt; int ind; }; deque red,blue; deque ret; map mp; void NG(){ cout<<"No"<>N; rep(i,N){ char c,x; int y; cin>>c>>x>>y; Ball b; b.color = c; b.ncolor = x; b.ncnt = y; b.ind = i; if(x=='R')red.push_back(b); else blue.push_back(b); } sort(red.begin(),red.end(),[&](Ball a,Ball b){ if(a.ncnt!=b.ncnt)return a.ncntb.color; }); solve(); NG(); return 0; }