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.*;

public class StairsAndElevators {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader inp = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(inp, out);
        out.close();
    }

    static class Solver {
        private static int cost(int loc, int x1, int x2) {
            return Math.abs(loc-x1)+Math.abs(loc-x2);
        }

        private static int search(int[] a, int x1, int x2, int n) {
            int l = 0;
            int r = n - 1;
            int cnt = 0;
            while (l < r-1) {
                if(++cnt > 1000) throw new RuntimeException();
                int mid = (l+r)>>1;
                int loc = a[mid];
                //if (x1 <= loc && loc <= x2) return x2-x1;
                if (loc >= x2) r = mid;
                else l = mid;

                //if (mid == n-1 || cost(a[mid],x1,x2) <= cost(a[mid+1],x1,x2)) r = mid;
                //else if (mid == 0 || cost(a[mid],x1,x2) <= cost(a[mid-1],x1,x2)) l = mid;
            }
            return Math.min(cost(a[l],x1,x2), cost(a[r],x1,x2));
        }

        private void solve(InputReader inp, PrintWriter out) {
            int n = inp.nextInt();
            int m = inp.nextInt();
            int ts = inp.nextInt();
            int te = inp.nextInt();
            int v = inp.nextInt();
            int[] stairs = new int[ts];
            for (int i = 0; i < ts; i++) stairs[i] = inp.nextInt();
            int[] elevators = new int[te];
            for (int i = 0; i < te; i++) elevators[i] = inp.nextInt();
            int q = inp.nextInt();
            for (int i = 0; i < q; i++) {
                int y1 = inp.nextInt();
                int x1 = inp.nextInt();
                int y2 = inp.nextInt();
                int x2 = inp.nextInt();
                int f = Math.abs(y1-y2);

                int costE = Integer.MAX_VALUE;
                if (te > 0) {
                    costE = f / v;
                    if (f % v != 0) costE++;
                    int ec = search(elevators, Math.min(x1, x2), Math.max(x1, x2), te);
                    costE += ec;
                }

                int costS = Integer.MAX_VALUE;
                if (ts > 0) {
                    costS = f;
                    int sc = search(stairs, Math.min(x1, x2), Math.max(x1, x2), ts);
                    costS += sc;
                }

                out.println(Math.min(costE, costS));
            }
        }
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

        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());
        }

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