using namespace std; struct node{ int count,id; }x[1010],y[1010]; int m,n,k,l,d; bool CMP1(node a,node b){ return a.count>b.count; } bool CMP2(node a,node b){ return a.id<b.id; } int main(){ cin >> m >> n >> k >> l >> d; for(int i=1,x1,y1,x2,y2;i<=d; i++){
cin >> x1 >> y1 >> x2 >> y2;
if(x1==x2){
y[min(y1,y2)].count++;
y[min(y1,y2)].id=min(y1,y2);
}
else if(y1==y2){
x[min(x1,x2)].count++;
x[min(x1,x2)].id=min(x1,x2);
}
}
sort(x+1,x+1+m,CMP1);
sort(x+1,x+1+k,CMP2);
sort(y+1,y+1+n,CMP1);
sort(y+1,y+1+l,CMP2);
for(int i=1;i<=k;i++)cout << x[i].id << " ";
cout << endl;
for(int i=1;i<=l;i++)cout << y[i].id << " ";
return 0; }
比赛已结束。