#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> N >> K; vector

a,c,e; vector

b,d,f; for(i=1;i<=6;i++){ if(i==1){ for(j=1;j<=N;j++){ int x; cin >> x; a.push_back(P(x,j)); } } if(i==2){ for(j=1;j<=N;j++){ int x; cin >> x; b.push_back(P(x,j)); } } if(i==3){ for(j=1;j<=2*N;j++){ int x; cin >> x; c.push_back(P(x,j)); } } if(i==4){ for(j=1;j<=2*N;j++){ int x; cin >> x; d.push_back(P(x,j)); } } if(i==5){ for(j=1;j<=N;j++){ int x; cin >> x; e.push_back(P(x,j)); } } if(i==6){ for(j=1;j<=N;j++){ int x; cin >> x; f.push_back(P(x,j)); } } } sort(a.begin(),a.end()); sort(c.begin(),c.end()); sort(e.begin(),e.end()); vector u,v,w,x; bool g=false; for(i=0;i t; for(k=0;k<2*N;k++){ if(c[k].first==-1) continue; if(e[i].first