#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } //INSERT ABOVE HERE signed paint(int k,int x){ cout<>t; return t; } signed main(){ int n; cin>>n; vector gs(n+1,0); gs[0]=0; for(int i=1;i<=n;i++){ set ss; // place one for(int j=0;j st(n,0); auto play=[&](){ int k,x; cin>>k>>x; x--; for(int i=0;i