#include #define FOR(I,X,Y) for(int I=X;I> N; vector ans; FOR(bfruisbvf,0,N){ cin >> q; if(q == 0){ cin >> n >> m; FOR(i,0,m)cin >> A[n][i]; } if(q == 1){ cin >> B; int p = -1; FOR(i,0,20)FOR(j,0,10){ if(B == A[i][j] && p == -1){ p = i; A[i][j] = " "; } } ans.push_back(p); } if(q == 2){ cin >> C; FOR(i,0,10)A[C][i] = " "; } } for(auto x:ans)cout << x << endl; }