#include using namespace std; int main(){ int N,M,a,b; cin>>N>>M; vector cup(3,0); cup[N-1]=1; for(int i=0;i>a>>b; int d=cup[b-1]; cup[b-1]=cup[a-1]; cup[a-1]=d; } for(int i=0;i<3;i++){ if(cup[i]==1) cout<