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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int cl = in.nextInt();
            int ce = in.nextInt();
            int v = in.nextInt();

            int[] l = new int[cl];
            for (int i = 0; i < cl; i++) {
                l[i] = in.nextInt() - 1;
            }

            int[] e = new int[ce];
            for (int i = 0; i < ce; i++) {
                e[i] = in.nextInt() - 1;
            }

            int q = in.nextInt();

            for (int i = 0; i < q; i++) {
                int x1 = in.nextInt() - 1;
                int y1 = in.nextInt() - 1;
                int x2 = in.nextInt() - 1;
                int y2 = in.nextInt() - 1;

                int distance = Math.abs(x1 - x2);
                int elevatorDistance = (distance + (v - 1)) / v;

                int d1 = Integer.MAX_VALUE;
                for (int kk = 0; kk < 2; kk++) {
                    if (left(y1, e, ce) != -1) {
                        int d = Math.abs(y1 - left(y1, e, ce));
                        d += elevatorDistance;
                        d += Math.abs(y2 - left(y1, e, ce));
                        d1 = Math.min(d, d1);
                    }

                    if (right(y1, e, ce) != -1) {
                        int d = Math.abs(y1 - right(y1, e, ce));
                        d += elevatorDistance;
                        d += Math.abs(y2 - right(y1, e, ce));
                        d1 = Math.min(d, d1);
                    }

                    if (left(y1, l, cl) != -1) {
                        int d = Math.abs(y1 - left(y1, l, cl));
                        d += distance;
                        d += Math.abs(y2 - left(y1, l, cl));
                        d1 = Math.min(d, d1);
                    }

                    if (right(y1, l, cl) != -1) {
                        int d = Math.abs(y1 - right(y1, l, cl));
                        d += distance;
                        d += Math.abs(y2 - right(y1, l, cl));
                        d1 = Math.min(d, d1);
                    }

                    int temp = y1;
                    y1 = y2;
                    y2 = temp;
                }

                out.println(d1);
            }
        }

        private int left(int x, int[] a, int n) {
            if (n < 1 || x < a[0]) return -1;
            int idx = searchInsert(a, x);
            if (idx >= 0 && idx < n && a[idx] == x) return x;
            return a[idx - 1];
        }

        private int right(int x, int[] a, int n) {
            if (n < 1 || x > a[n - 1]) return -1;
            int idx = searchInsert(a, x);
            if (idx >= 0 && idx < n && a[idx] == x) return x;
            return a[idx];
        }

        private int searchInsert(int[] nums, int target) {
            int i = 0;
            int j = nums.length - 1;

            while (i <= j) {
                int mid = (i + j) / 2;

                if (target > nums[mid]) {
                    i = mid + 1;
                } else if (target < nums[mid]) {
                    j = mid - 1;
                } else {
                    return mid;
                }
            }

            return i;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

    }
}

