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.io.*;
public class StairsElevators {
    
    
    
    /************************ SOLUTION STARTS HERE ************************/
    
    static TreeSet<Long> stairs, elevs;
    
    static final long INF = (long) 1e15;
    
    static long checkPossibility(long speed, long x1, long y1, long x2, long y2, TreeSet<Long> set) {

        Long toCheck[] = new Long[4];
        toCheck[0] = set.floor(y1);
        toCheck[1] = set.ceiling(y1);
        toCheck[2] = set.floor(y2);
        toCheck[3] = set.ceiling(y2);

        long minCost = x1 == x2 ? Math.abs(y1 - y2) : INF;
        for (Long pt : toCheck)
            if (pt != null) {
                long cost = 0;
                long htDiff = Math.abs(x1 - x2);
                cost += Math.abs(y1 - pt);
                cost += (htDiff + speed - 1) / speed;
                cost += Math.abs(y2 - pt);
                minCost = Math.min(minCost, cost);
            }

        return minCost;
    }
    
    private static void solve() {
        
        
        long n = nextInt();
        long m = nextInt();
        
        int cl = nextInt();
        int ce = nextInt();
        
        int v = nextInt();
        
        stairs = new TreeSet<>();
        elevs  = new TreeSet<>();
        
        Arrays.stream(nextLongArray(cl)).forEach(stairs::add);
        Arrays.stream(nextLongArray(ce)).forEach(elevs::add);
        
        
        int q = nextInt();
        while(q-->0) {

            int x1 = nextInt();
            int y1 = nextInt();
            int x2 = nextInt();
            int y2 = nextInt();
            
            long optCost = Math.min(checkPossibility(1, x1, y1, x2, y2, stairs), 
                                    checkPossibility(v, x1, y1, x2, y2, elevs));
            
            
            println(optCost);
        }
        
    }
    
    
    
    /************************ SOLUTION ENDS HERE ************************/
    
    
    
    
    
    /************************ TEMPLATE STARTS HERE **********************/
    
    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
        st     = null;
        solve();
        reader.close();
        writer.close();
    }
    
    static BufferedReader reader;
    static PrintWriter    writer;
    static StringTokenizer st;
    
    static String next()
    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}            
    st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
    static String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}             
    static int    nextInt()   {return Integer.parseInt(next());}
    static long   nextLong()  {return Long.parseLong(next());}     
    static double nextDouble(){return Double.parseDouble(next());}
    static char   nextChar()  {return next().charAt(0);}
    static int[]  nextIntArray(int n)         {int[] a= new int[n];   int i=0;while(i<n){a[i++]=nextInt();}  return a;}
    static long[] nextLongArray(int n)        {long[]a= new long[n];  int i=0;while(i<n){a[i++]=nextLong();} return a;}    
    static int[]  nextIntArrayOneBased(int n) {int[] a= new int[n+1]; int i=1;while(i<=n){a[i++]=nextInt();} return a;}            
    static long[] nextLongArrayOneBased(int n){long[]a= new long[n+1];int i=1;while(i<=n){a[i++]=nextLong();}return a;}            
    static void   print(Object o)  { writer.print(o);  }
    static void   println(Object o){ writer.println(o);}
    
    /************************ TEMPLATE ENDS HERE ************************/
    
}