import java.io.*; import java.util.*; class Main { public static void main(String args[])throws Exception { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); String s[]=bu.readLine().split(" "); int n=Integer.parseInt(s[0]),m=Integer.parseInt(s[1]); int a[][]=new int[n+m][2],ans[]=new int[n],i; s=bu.readLine().split(" "); for(i=0;i() { @Override public int compare(int[] o1, int[] o2) { if(o1[0]>o2[0]) return 1; else if(o1[0]==o2[0]) return o1[1]=0) { int j=i; while(j=0) j++; if(j