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.*;
import java.util.Arrays;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.function.Function;

public class Main {

    static int H, W, CLN, CEN, V;
    static int[] CL, CE;
    static int Q;
    static int[] H1, W1, H2, W2;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        CLN = sc.nextInt();
        CEN = sc.nextInt();
        V = sc.nextInt();
        if( CLN != 0 ) {
            CL = sc.nextIntArray(CLN);
        } else {
            sc.nextLine();
            CL = new int[0];
        }
        if( CEN != 0 ) {
            CE = sc.nextIntArray(CEN);
        } else {
            sc.nextLine();
            CE = new int[0];
        }
        Q = sc.nextInt();
        H1 = new int[Q];
        W1 = new int[Q];
        H2 = new int[Q];
        W2 = new int[Q];
        for (int i = 0; i < Q; i++) {
            H1[i] = sc.nextInt();
            W1[i] = sc.nextInt();
            H2[i] = sc.nextInt();
            W2[i] = sc.nextInt();
        }

        writeLines(solve());
    }

    static int[] solve() {
        Arrays.sort(CL);
        Arrays.sort(CE);

        int[] ans = new int[Q];
        for (int i = 0; i < Q; i++) {
            ans[i] = calc(i);
        }
        return ans;
    }

    static int calc(int i) {
        int h1 = H1[i];
        int w1 = W1[i];
        int h2 = H2[i];
        int w2 = W2[i];

        int ret = Integer.MAX_VALUE;
        if( CLN != 0 ) {
            int b = upperBound(CL, w2);
            if( b != 0 ) {
                ret = Math.min(stair(h1, w1, h2, w2, CL[b-1]) , ret);
            }
            if( b != CLN ) {
                ret = Math.min(stair(h1, w1, h2, w2, CL[b]) , ret);
            }
        }

        if( CEN != 0 ) {
            int b = upperBound(CE, w2);
            if( b != 0 ) {
                ret = Math.min(elevator(h1, w1, h2, w2, CE[b-1]) , ret);
            }
            if( b != CEN ) {
                ret = Math.min(elevator(h1, w1, h2, w2, CE[b]) , ret);
            }
        }

        return ret;
    }

    static int stair(int h1, int w1, int h2, int w2, int s) {
        return Math.abs(w1 - s) + Math.abs(h1-h2) + Math.abs(w2-s);
    }

    static int elevator(int h1, int w1, int h2, int w2, int e) {
        return Math.abs(w1 - e) + (Math.abs(h1-h2)+V-1)/V + Math.abs(w2 - e);
    }

    static int upperBound(int[] array, int value) {
        int low = 0;
        int high = array.length;
        int mid;
        while( low < high ) {
            mid = ((high - low) >>> 1) + low; // (high + low) / 2
            if( array[mid] <= value ) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        return low;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

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

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

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        int[] nextIntArray(int n, int delta) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt() + delta;
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static <A> void writeLines(A[] as, Function<A, String> f) {
        PrintWriter pw = new PrintWriter(System.out);
        for (A a : as) {
            pw.println(f.apply(a));
        }
        pw.flush();
    }

    static void writeLines(int[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (int a : as) pw.println(a);
        pw.flush();
    }

    static void writeLines(long[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (long a : as) pw.println(a);
        pw.flush();
    }

    static int max(int... as) {
        int max = Integer.MIN_VALUE;
        for (int a : as) max = Math.max(a, max);
        return max;
    }

    static int min(int... as) {
        int min = Integer.MAX_VALUE;
        for (int a : as) min = Math.min(a, min);
        return min;
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            if (arg instanceof int[]) j.add(Arrays.toString((int[]) arg));
            else if (arg instanceof long[]) j.add(Arrays.toString((long[]) arg));
            else if (arg instanceof double[]) j.add(Arrays.toString((double[]) arg));
            else if (arg instanceof Object[]) j.add(Arrays.toString((Object[]) arg));
            else j.add(arg.toString());
        }
        System.err.println(j.toString());
    }
}
