#include #include #include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,k,x; cin>>n>>k>>x; vector a(k),b(k); x--; for(int i = 0;i>c>>c; a[i] = b[i] = -1; continue; } cin>>a[i]>>b[i]; a[i]--;b[i]--; } vector now(n,0); for(int i = 0;i c(n); for(int i = 0;i>c[i]; c[i]--; } for(int i = k-1;i>x;i--){ swap(c[a[i]],c[b[i]]); } int ni = -1,nj = -1; for(int i = 0;i