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.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.StringTokenizer;

public class Main {
    
    public static void main(String[] args) throws UnsupportedEncodingException, IOException, Exception {
        Reader.init(System.in);
        StringBuilder out = new StringBuilder();
        long n = Reader.nextLong(), m = Reader.nextLong();
        int s = Reader.nextInt(), e = Reader.nextInt();
        long v = Reader.nextLong(), S[] = new long[s], E[] = new long[e];
        for(int i = 0; i < s; i++)
            S[i] = Reader.nextLong();
        for(int i = 0; i < e; i++)
            E[i] = Reader.nextLong();
        int q = Reader.nextInt();
        long x1, x2, y1, y2, min;
        while(q-- > 0) {
            x1 = Reader.nextLong();
            y1 = Reader.nextLong();
            x2 = Reader.nextLong();
            y2 = Reader.nextLong();
            if(x1 == x2) {
                out.append(Math.abs(y2 - y1));
                continue;
            }
            min = Long.MAX_VALUE;
            min = Math.min(min, calc(x1, y1, x2, y2, upperBound(S, y1), false, v));
            min = Math.min(min, calc(x1, y1, x2, y2, upperBound(S, y2), false, v));
            min = Math.min(min, calc(x1, y1, x2, y2, lowerBound(S, y1), false, v));
            min = Math.min(min, calc(x1, y1, x2, y2, lowerBound(S, y2), false, v));
            min = Math.min(min, calc(x1, y1, x2, y2, upperBound(E, y1), true, v));
            min = Math.min(min, calc(x1, y1, x2, y2, upperBound(E, y2), true, v));
            min = Math.min(min, calc(x1, y1, x2, y2, lowerBound(E, y1), true, v));
            min = Math.min(min, calc(x1, y1, x2, y2, lowerBound(E, y2), true, v));
            out.append(min).append('\n');
        }
        PrintWriter pw = new PrintWriter(System.out);
        pw.print(out);
        pw.close();
    }
    
    static long calc(long x1, long y1, long x2, long y2, long p, boolean e, long v) {
        if(p == -1)
            return Long.MAX_VALUE;
        long res = Math.abs(y1 - p) + Math.abs(y2 - p);
        if(e) {
            long d = Math.abs(x1 - x2);
            long u = d / v;
            if(d % v > 0)
                u++;
            res += u;
        } else
            res += Math.abs(x1 - x2);
        return res;
    }
    
    static long upperBound(long[] arr, long y) {
        int l = 0, r = arr.length - 1, m;
        long best = -1;
        while(l <= r) {
            m = (l + r) / 2;
            if(arr[m] < y) {
                l = m + 1;
                continue;
            }
            if(best == -1)
                best = arr[m];
            else best = Math.min(best, arr[m]);
            r = m - 1;
        }
        return best;
    }
    
    static long lowerBound(long[] arr, long y) {
        int l = 0, r = arr.length - 1, m;
        long best = -1;
        while(l <= r) {
            m = (l + r) / 2;
            if(arr[m] > y) {
                r = m - 1;
                continue;
            }
            if(best == -1)
                best = arr[m];
            else best = Math.max(best, arr[m]);
            l = m + 1;
        }
        return best;
    }

}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(
                new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    static void init(String url) throws FileNotFoundException {
        reader = new BufferedReader(new FileReader(url));
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}