2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

import java.util.*;
import java.lang.*;
import java.io.*;
 

 public class Solution{     
 public static int findMin(int l1, int r1, int l2, int r2,int[] stairs, int[] ele, int v){
       if(l1 == l2)
        return Math.abs(r1-r2);
        
        int s = Integer.MAX_VALUE;
        if(stairs.length > 0)
         s = binarySearch(stairs,l1,r1,l2,r2,-1);

         
         int e = Integer.MAX_VALUE;
         if(ele.length > 0)
          e = binarySearch(ele,l1,r1,l2,r2,v);
          
          return Math.min(e,s);
   } 
   
   public static int binarySearch(int[] move, int l1, int r1, int l2, int r2,int v){
       int ind = Arrays.binarySearch(move,r1);
       int steps = Integer.MAX_VALUE;
        if(ind < 0){
            ind = -ind-1;
            if(ind > 0)
                steps = Math.abs(move[ind-1]-r2)+Math.abs(move[ind-1]-r1);
            if(ind < move.length)
             steps = Math.min(Math.abs(move[ind]-r2)+Math.abs(move[ind]-r1),steps);
        }
        if(v == -1)
         steps+=l2-l1;
         else{
             steps+=(l2-l1)/v;
             steps+= ((l2-l1)%v > 0)?1:0;
         }
        return steps;
   }
   
   public static void main (String[] args)throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		int c1 = Integer.parseInt(st.nextToken());
		int c2 = Integer.parseInt(st.nextToken());
		int v = Integer.parseInt(st.nextToken());
		
		int[] stairs = new int[c1];
		st = new StringTokenizer(br.readLine());
		 for(int i=0; i<c1; i++)
		   stairs[i] = Integer.parseInt(st.nextToken());
		   
		int[] elevator = new int[c2];
		st = new StringTokenizer(br.readLine());
		
		  for(int i=0; i<c2; i++)
		   elevator[i] = Integer.parseInt(st.nextToken());
		   
		st = new StringTokenizer(br.readLine()); 
	    int queries = Integer.parseInt(st.nextToken());
	    
	    for(int i=0; i<queries; i++){
	       st = new StringTokenizer(br.readLine());
	       int a =  Integer.parseInt(st.nextToken());
	       int b = Integer.parseInt(st.nextToken());
	       int x = Integer.parseInt(st.nextToken());
	       int y = Integer.parseInt(st.nextToken());
	       
	       if(a <= x)
	        out.println(findMin(a,b,x,y,stairs,elevator,v));
	        else
	        out.println(findMin(x,y,a,b,stairs,elevator,v));
	    }
           
          out.close();
	}
}