#include #include using namespace std; //ios::sync_with_stdio(0);cin.tie(nullptr); #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define rep(i,a,b) for(LL i = a;ib; i--) #define tobirep(i,a,b,c) for(LL i = a;ib; i-=c) #define INF ((1LL<<62)-(1LL<<31)) #define ooki 9223372036854775807 #define tii -9223372036854775808 typedef long long LL; int main(){ ios::sync_with_stdio(0);cin.tie(nullptr); LL n,m; cin >> n >> m; vector t(4); t[1]=1; t[2]=0; t[3]=0; rep(i,0,m){ LL a,b; cin >> a >> b; swap(t[a],t[b]); } rep(i,1,4){ if(t[i]==1){cout<