#include using namespace std; typedef long long ll; int main() { int n,k,x; cin>>n>>k>>x; x--; int a[n],b[n]; for (int i=0;i>ch>>ch; continue; } cin>>c[i]>>d[i]; c[i]--,d[i]--; } for (int i=0;i>b[i]; for (int i=0;ix;i--) swap(b[c[i]],b[d[i]]); for (int i=0;i