#include using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; vector > h(a); vector ans(b); for(int i=0;i>d>>e>>f; if(d==1){ h.at(f-1).push(e); } else{ int g=h.at(e-1).front(); ans.at(h.at(e-1).front()-1)++; h.at(e-1).pop(); h.at(f-1).push(g); } } for(int j=0;j