#include #include using namespace std; int main (void){ int N = 0, M = 0; int P[200] = { 0 }, Q[200] = { 0 }; bool cup[3] = { false }; // input cin >> N >> M; for(int i = 0; i < M; i++){ cin >> P[i] >> Q[i]; } // solve for(int i = 0; i < 3; i++){ if(i == (N - 1)){ cup[i] = true; } else{ cup[i] = false; } } for(int i = 0; i < M; i++){ swap(cup[P[i] - 1], cup[Q[i] - 1]); } // output for(int i = 0; i < 3; i++){ if(cup[i]){ cout << i + 1 << endl; } } return 0; }