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.util.*;
import java.io.*;

public class Solution2 {

    int INF = 1_000_000_000;

    private void solve() throws IOException {

        int n = in.nextInt();
        int m = in.nextInt();
        int colStairs = in.nextInt();
        int colLifts = in.nextInt();
        int velocity = in.nextInt();
        int[] stairs = new int[colStairs + 2];
        stairs[0] = -1;
        stairs[colStairs + 1] = INF;
        int[] lifts = new int[colLifts + 2];
        lifts[0] = -1;
        lifts[colLifts + 1] = INF;
        for (int i = 1; i < colStairs + 1; i++) {
            stairs[i] = in.nextInt();
        }
        for (int i = 1; i < colLifts + 1; i++) {
            lifts[i] = in.nextInt();
        }
        int q = in.nextInt();
        for (int i = 0; i < q; i++) {
            int y1 = in.nextInt();
            int x1 = in.nextInt();
            int y2 = in.nextInt();
            int x2 = in.nextInt();
            if (y1 == y2) {
                System.out.println(Math.abs(y2 - y1));
            }
            else {
                int sl = binarySearchLeft(stairs, x1);
                int ll = binarySearchLeft(lifts, x1);
                int sr = binarySearchRight(stairs, x1);
                int lr = binarySearchRight(lifts, x1);
                int dist1 = INF;
                if (sl != -1 || sl != INF) {
                    dist1 = dist(sl, x1) + dist(sl, x2) + dist(y1, y2);
                }
                int dist2 = INF;
                if (sr != -1 || sr!= INF) {
                    dist2 = dist(sr, x1) + dist(sr, x2) + dist(y1, y2);
                }
                int dist3 = INF;
                if (ll != -1 || ll != INF) {
                    dist3 = dist(ll, x1) + dist(ll, x2) + (dist(y1, y2) + velocity - 1) / velocity;
                }
                int dist4 = INF;
                if (lr != -1 || lr != INF) {
                    dist4 = dist(lr, x1) + dist(lr, x2) + (dist(y1, y2) + velocity - 1) / velocity;
                }
                System.out.println(Math.min(Math.min(dist1, dist2), Math.min(dist3, dist4)));
            }
        }

    }

    private int dist(int x1, int x2) {
        if (x1 == -1 || x2 == INF || x1 == INF || x2 == -1) {
            return INF;
        }
        return Math.abs(x1 - x2);
    }

    private int binarySearchRight(int[] mas, int x) {
        int min = 0;
        int max = mas.length - 1;
        while (min < max - 1) {
            int mid = min + (max - min) / 2;
            int value = mas[mid];
            if (value < x) {
                min = mid;
            }
            else {
                max = mid;
            }
        }
        return mas[max];
    }

    private int binarySearchLeft(int[] mas, int x) {
        int min = 0;
        int max = mas.length - 1;
        while (min < max - 1) {
            int mid = min + (max - min) / 2;
            int value = mas[mid];
            if (value > x) {
                max = mid;
            }
            else {
                min = mid;
            }
        }
        return mas[min];
    }

    private PrintWriter out;
    private MyScanner in;

    private void run() throws IOException {
        in = new MyScanner();
        out = new PrintWriter(System.out);
        solve();
        in.close();
        out.close();
    }

    private class MyScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public MyScanner() throws IOException {
            this.br = new BufferedReader(new InputStreamReader(System.in));
        }

        public MyScanner(String fileTitle) throws IOException {
            this.br = new BufferedReader(new FileReader(fileTitle));
        }

        public String nextLine() throws IOException {
            String s = br.readLine();
            return s == null ? "-1" : s;
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return "-1";
                }
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        public Integer nextInt() throws IOException {
            return Integer.parseInt(this.next());
        }

        public Long nextLong() throws IOException {
            return Long.parseLong(this.next());
        }

        public Double nextDouble() throws IOException {
            return Double.parseDouble(this.next());
        }

        public void close() throws IOException {
            this.br.close();
        }
    }

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Solution2().run();
    }
}
