#include using namespace std; using Int = long long; //INSERT ABOVE HERE signed main(){ Int n,k,x; cin>>n>>k>>x; x--; vector a(k),b(k); for(Int i=0;i>a[i]>>b[i]; else cin>>y>>y; } vector c(n),d(n); for(Int i=0;i>c[i]; iota(d.begin(),d.end(),0); for(Int i=0;ix;i--) swap(d[a[i]],d[b[i]]); Int p=-1,q=-1; for(Int i=0;iq) swap(p,q); cout<