import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashSet; import java.util.PriorityQueue; class cloudy_day { static class Scanner { BufferedReader br; StringTokenizer tk=new StringTokenizer(""); public Scanner(InputStream is) { br=new BufferedReader(new InputStreamReader(is)); } public int nextInt() throws IOException { if(tk.hasMoreTokens()) return Integer.parseInt(tk.nextToken()); tk=new StringTokenizer(br.readLine()); return nextInt(); } public long nextLong() throws IOException { if(tk.hasMoreTokens()) return Long.parseLong(tk.nextToken()); tk=new StringTokenizer(br.readLine()); return nextLong(); } public String next() throws IOException { if(tk.hasMoreTokens()) return (tk.nextToken()); tk=new StringTokenizer(br.readLine()); return next(); } public String nextLine() throws IOException { tk=new StringTokenizer(""); return br.readLine(); } public double nextDouble() throws IOException { if(tk.hasMoreTokens()) return Double.parseDouble(tk.nextToken()); tk=new StringTokenizer(br.readLine()); return nextDouble(); } public char nextChar() throws IOException { if(tk.hasMoreTokens()) return (tk.nextToken().charAt(0)); tk=new StringTokenizer(br.readLine()); return nextChar(); } public int[] nextIntArray(int n) throws IOException { int a[]=new int[n]; for(int i=0;i { long v; int t; long x; int i; evt(long x,long v,int t,int i) { this.x=x; this.v=v; this.t=t; this.i=i; } @Override public int compareTo(evt o) { if(x!=o.x) { return Long.compare(x, o.x); } return Integer.compare(t, o.t); } } public static void main(String args[]) throws IOException { Scanner in=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); int n=in.nextInt(); long p[]=in.nextLongArray(n); long x[]=in.nextLongArray(n); int m=in.nextInt(); long y[]=in.nextLongArray(m); long r[]=in.nextLongArray(m); PriorityQueue pq=new PriorityQueue(); HashSet h=new HashSet<>(); for(int i=0;i