#include #include #include #include using namespace std; int main(){ vector a(4); int n, m; cin >> n >> m; a[n] = "o"; for (int i = 1; i < n; i++) { if (i == n) continue; a[i] = "x"; } int p, q; for (int i = 0; i < m; i++) { cin >> p >> q; swap(a[p], a[q]); } for (int i = 1; i < 4; i++) { if (a[i] == "o") { cout << i << endl; } } return 0; }