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


/**
 * @author: Mehul Raheja
 */

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

public class C{

    /*
        Runtime = O()
     */
    static int N, M, K;
    static String s;
    static StringTokenizer st;
    static int[] d;
    
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));        
        st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        int CL = Integer.parseInt(st.nextToken());
        int CE = Integer.parseInt(st.nextToken());
        int V = Integer.parseInt(st.nextToken());
        
        TreeSet<Integer> s = new TreeSet();
        TreeSet<Integer> e = new TreeSet();
        
        st = new StringTokenizer(br.readLine());
        for (int i = 0; i < CL; i++) {
            
            s.add(Integer.parseInt(st.nextToken()));
        }
        
        st = new StringTokenizer(br.readLine());
        for (int i = 0; i < CE; i++) {
            e.add(Integer.parseInt(st.nextToken()));
        }
        
        st = new StringTokenizer(br.readLine());
        int Q = Integer.parseInt(st.nextToken());
        
        for (int i = 0; i < Q; i++) {
            st = new StringTokenizer(br.readLine());
            int sy = Integer.parseInt(st.nextToken());
            int sx = Integer.parseInt(st.nextToken());
            int ey = Integer.parseInt(st.nextToken());
            int ex = Integer.parseInt(st.nextToken());
            
            int ans = 1<<30;
            if(s.ceiling(sx) != null){
                int t = s.ceiling(sx);
                int t2 = Math.abs(t - sx) + Math.abs(sy-ey) + Math.abs(ex - t);
                ans = Math.min(ans,t2);
            }
            if(s.floor(sx) != null){
                int t = s.floor(sx);
                int t2 = Math.abs(t - sx) + Math.abs(sy-ey) + Math.abs(ex - t);
                ans = Math.min(ans,t2);
            }
            if(e.ceiling(sx) != null){
                int t = e.ceiling(sx);
                int t2 = Math.abs(t - sx) + (int)Math.ceil(Math.abs(sy-ey)/((double)V)) + Math.abs(ex - t);
//                if(t2 < ans){
//                    System.out.println(Math.abs(t - sx));
//                    System.out.println((int)Math.ceil(Math.abs(sy-ey)/((double)V)));
//                    System.out.println(Math.abs(ex - t));
//                    System.out.println("HERE");
//                }
                ans = Math.min(ans,t2);
            }
            if(e.floor(sx) != null){
                int t = e.floor(sx);
                int t2 = Math.abs(t - sx) + (int)Math.ceil(Math.abs(sy-ey)/((double)V)) + Math.abs(ex - t);
                ans = Math.min(ans,t2);
            }
            
            System.out.println(ans);
            
        }
    }    
}
