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.awt.*;
import java.lang.*;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;


public class Main {


    public void solve() throws IOException {
        int n = nextInt(), m = nextInt(), cl = nextInt(), ce = nextInt(), v = nextInt();
        int l[] = new int[cl];
        for (int i = 0; i < cl; i++) {
            l[i] = nextInt();
        }
        int e[] = new int[ce];
        for (int i = 0; i < ce; i++) {
            e[i] = nextInt();
        }
        int q = nextInt();
        while (q-- > 0) {
            int x1 = nextInt(), y1 = nextInt(), x2 = nextInt(), y2 = nextInt();
            if(x1 == x2){
                out.println(Math.abs(y1 - y2));
                continue;
            }
            int ansl = 0, anse = 0;
            int ans = Integer.MAX_VALUE;
            if (cl == 0) ansl = Integer.MAX_VALUE;
            else {
                ansl = Math.abs(x1 - x2);
                if (l[0] < y1) {
                    int left = 0, right = cl;
                    while (right - left > 1) {
                        int mid = (left + right) / 2;
                        if (l[mid] > y1) right = mid;
                        else left = mid;
                    }
                    ans = Math.min(ansl + Math.abs(l[left] - y1) + Math.abs(l[left] - y2), ans);
                }
                if (l[cl - 1] > y1) {
                    int left = -1, right = cl - 1;
                    while (right - left > 1) {
                        int mid = (left + right) / 2;
                        if (l[mid] > y1) right = mid;
                        else left = mid;
                    }
                    ans = Math.min(ansl + Math.abs(l[right] - y1) + Math.abs(l[right] - y2), ans);
                }

            }
            if (ce == 0) anse = Integer.MAX_VALUE;
            else {
                anse = (Math.abs(x1 - x2) + v - 1) / v;
                if (e[0] < y1) {
                    int left = 0, right = ce;
                    while (right - left > 1) {
                        int mid = (left + right) / 2;
                        if (e[mid] > y1) right = mid;
                        else left = mid;
                    }
                    ans = Math.min(anse + Math.abs(e[left] - y1) + Math.abs(e[left] - y2), ans);
                }
                if (e[ce - 1] > y1) {
                    int left = -1, right = ce - 1;
                    while (right - left > 1) {
                        int mid = (left + right) / 2;
                        if (e[mid] > y1) right = mid;
                        else left = mid;
                    }
                    ans = Math.min(anse + Math.abs(e[right] - y1) + Math.abs(e[right] - y2), ans);
                }

            }
            out.println(ans);
        }
    }

    BufferedReader br;
    StringTokenizer sc;
    PrintWriter out;

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

    void run() throws IOException {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    String nextToken() throws IOException {
        while (sc == null || !sc.hasMoreTokens()) {
            try {
                sc = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return sc.nextToken();
    }

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

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

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