#include using namespace std; using ll=long long; #define rep2(i, a, n) for(int i = (a); i < (n); i++) #define rep(i, n) rep2(i,0,n) int main(){ cin.tie(nullptr);ios_base::sync_with_stdio(false); int n,m,a,b; cin>>n>>m; vector hoge(3,false); hoge[n-1]=true; rep(i,m){ cin>>a>>b; swap(hoge[a-1],hoge[b-1]); } rep(i,3){ if(hoge[i]){ cout<