#include using namespace std; using pii=pair; using tii=tuple; using qii=tuple; using ll=long long; using ld=long double; const int INF=1e9; #define rep(i,n) for (int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a front,center,back; struct Solver{ void solve(){ set st_back,st_center; rep(i,N) st_back.insert({back[i].w,i}); rep(i,2*N) st_center.insert({center[i].w,i}); vector> ans(K,vector(4,-10)); //back->front->center1->center2 int cnt_tree=0; vector front_ord(N),center_ord(2*N); rep(i,N) front_ord[i]=i; rep(i,2*N) center_ord[i]=i; sort(all(front_ord),[&](int i,int j){return front[j].w> st(4); rep(i,K){ cout << ans[i][1]+1 << ' ' << ans[i][2]+1 << ' ' << ans[i][3]+1 << ' ' << ans[i][0]+1 << '\n'; } } }Solver; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> K; front.resize(N); rep(i,N) cin >> front[i].w; rep(i,N) cin >> front[i].h; center.resize(2*N); rep(i,2*N) cin >> center[i].w; rep(i,2*N) cin >> center[i].h; back.resize(N); rep(i,N) cin >> back[i].w; rep(i,N) cin >> back[i].h; Solver.solve(); }