#include using namespace std; int main(){ int N,M,P,Q; cin >> N >> M; bool found[3]={false,false,false}; found[N-1]=true; for(int i=0;i> P >> Q; bool tmp=found[P-1]; found[P-1]=found[Q-1]; found[Q-1]=tmp; } for(int i=0;i<3;i++){ if(found[i])cout << i+1 << endl; } return 0; }