#include using namespace std; #define rep(i,n) for(ll i=0;i=0;i--) #define fi first #define se second #define all(x) (x).begin(),(x).end() #define CST(x) cout<; using vvl=vector>; using pl=pair; template inline bool chmin(T& a, T b){ if(a>b){a = b;return true;}return false;} template inline bool chmax(T& a, T b){ if(a>N; info[--N]++; int M;cin>>M; while(M--){ int p,q;cin>>p>>q; swap(info[--p],info[--q]); } rep(i,3)if(info[i])cout<