#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i, n) for(ll i = 0;i < n;i++) #define REPR(i, n) for(ll i = n;i >= 0;i--) #define FOR(i, m, n) for(ll i = m;i < n;i++) #define FORR(i, m, n) for(ll i = m;i >= n;i--) #define REPO(i, n) for(ll i = 1;i <= n;i++) #define ll long long #define INF (ll)1 << 60 #define MINF (-1 * INF) #define ALL(n) n.begin(),n.end() #define MOD 1000000007 #define P pair ll n, m; bool koko[3]; int main() { cin >> n >> m; koko[n - 1] = true; REP(i, m) { ll a, b; cin >> a >> b; a--; b--; if (koko[a]) { koko[a] = false; koko[b] = true; } else if (koko[b]) { koko[a] = true; koko[b] = false; } } REP(i, 3)if (koko[i])cout << i + 1 << endl; }