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.BufferedReader;
// import java.io.FileInputStream;
// import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;

import static java.util.Arrays.fill;
import static java.util.Arrays.sort;
import static java.util.Collections.reverseOrder;
import static java.lang.Math.*;

public class Main {
    FastScanner in;
    PrintWriter out;

    private void solve() throws IOException {
        solveC();
    }

    private void solveA() throws IOException {
        int n = in.nextInt(), s = in.nextInt();
        int[] a = new int[n + 1];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt() * 60 + in.nextInt();
        }
        a[n] = (int) 1e9;
        if (a[0] > s) {
            out.println("0 0");
            return;
        }
        for (int i = 0; i < n; i++) {
            if (a[i + 1] > a[i] + 2 * s + 1) {
                out.println((a[i] + s) / 60 + " " + ((a[i] + s) % 60));
                return;
            }
        }
    }

    private void solveB() throws IOException {
        int n = in.nextInt() - 1;
        long A = in.nextInt(), B = in.nextInt(), s1 = in.nextInt();
        long[] s = new long[n];
        long S = s1;
        for (int i = 0; i < n; i++) {
            S += s[i] = in.nextInt();
        }
        if (s1 * A >= B * S) {
            out.println(0);
            return;
        }
        shuffle(s);
        sort(s);
        reverse(s);
        for (int i = 0; i < n; i++) {
            S -= s[i];
            if (s1 * A >= B * S) {
                out.println(i + 1);
                return;
            }
        }
    }

    void shuffle(long[] a) {
        long b;
        Random r = new Random();
        for (int i = a.length - 1, j; i > 0; i--) {
            j = r.nextInt(i + 1);
            b = a[j];
            a[j] = a[i];
            a[i] = b;
        }
    }

    void reverse(long[] a) {
        long b;
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            b = a[i];
            a[i] = a[j];
            a[j] = b;
        }
    }

    private void solveC() throws IOException {
        long n = in.nextInt(), m = in.nextInt();
        int nl = in.nextInt(), ne = in.nextInt();
        long v = in.nextInt();

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

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

        int q = in.nextInt();
        while (q-- > 0) {
            long i1 = in.nextInt(), j1 = in.nextInt(), i2 = in.nextInt(), j2 = in.nextInt();

            if (i1 == i2) {
                out.println(abs(j1 - j2));
                continue;
            }

            int ll = 0, rl = nl;
            while (ll + 1 < rl) {
                int mid = (ll + rl) / 2;
                if (l[mid] < j1)
                    ll = mid;
                else
                    rl = mid;
            }

            int le = 0, re = ne;
            while (le + 1 < re) {
                int mid = (le + re) / 2;
                if (e[mid] < j1)
                    le = mid;
                else
                    re = mid;
            }

            out.println(min(min(abs(j1 - l[ll]) + abs(i1 - i2) + abs(l[ll] - j2),
                    abs(j1 - l[rl]) + abs(i1 - i2) + abs(l[rl] - j2)),
                    min(abs(j1 - e[le]) + (abs(i1 - i2) + v - 1) / v + abs(e[le] - j2),
                            abs(j1 - e[re]) + (abs(i1 - i2) + v - 1) / v + abs(e[re] - j2))));
        }
    }

    class Pair implements Comparable<Pair> {
        long c;
        int id;

        Pair(long cc, int i) {
            c = cc;
            id = i;
        }

        @Override
        public int compareTo(Pair o) {
            return c == o.c ? id - o.id : Long.compare(c, o.c);
        }

        @Override
        public String toString() {
            return "(" + c + " [" + id + "])";
        }
    }

    private void solveD() throws IOException {
        int n = in.nextInt();
        long x1 = in.nextInt(), x2 = in.nextInt();
        boolean swap = false;
        if (x1 < x2) {
            long x = x1;
            x1 = x2;
            x2 = x;
            swap = true;
        }

        // out.println("swap = " + swap);

        Pair[] c = new Pair[n];
        for (int i = 0; i < n; i++) {
            c[i] = new Pair(in.nextInt(), i);
        }
        shuffle(c);
        sort(c);
        reverse(c);

        int[] k1 = new int[n], k11 = new int[n];
        for (int i = 0, cnt = 1; i < n; i++) {
            while (cnt < 1e6 && c[i].c < (x1 + cnt - 1) / cnt)
                cnt++;
            k1[i] = cnt - 1;
            k11[i] = k1[i] - i;
        }

        int[] k2 = new int[n], k22 = new int[n];
        for (int i = 0, cnt = 1; i < n; i++) {
            while (cnt < 1e6 && c[i].c < (x2 + cnt - 1) / cnt)
                cnt++;
            k2[i] = cnt - 1;
            k22[i] = k2[i] - i;
        }

        Pair[] leftMink22 = new Pair[n];
        leftMink22[0] = new Pair(k22[0], 0);
        for (int i = 1; i < n; i++) {
            if (k22[i] < leftMink22[i - 1].c)
                leftMink22[i] = new Pair(k22[i], i);
            else
                leftMink22[i] = leftMink22[i - 1];
        }

        Pair[] rightMink22 = new Pair[n];
        rightMink22[n - 1] = new Pair(k22[n - 1], n - 1);
        for (int i = n - 2; i >= 0; i--) {
            if (k22[i] < rightMink22[i + 1].c)
                rightMink22[i] = new Pair(k22[i], i);
            else
                rightMink22[i] = rightMink22[i + 1];
        }

        /*
        out.println(Arrays.toString(c));
        out.println(Arrays.toString(k1));
        out.println(Arrays.toString(k11));
        out.println(Arrays.toString(k2));
        out.println(Arrays.toString(k22));
        out.println(Arrays.toString(leftMink22));
        out.println(Arrays.toString(rightMink22));
        out.println();
        out.flush();
        */

        for (int realk1 = 0; realk1 < n; realk1++) {
            if (k11[realk1] <= 0) {
                if (-k11[realk1] > 0 && leftMink22[-k11[realk1] - 1].c <= 0) {
                    out.println("Yes");

                    // out.println("1 " + realk1 + " " + (-k11[realk1] - 1));
                    // out.println((realk1 + 1 + k11[realk1]) + " " + (leftMink22[-k11[realk1] - 1].id + 1));

                    ArrayList<Integer> a1 = new ArrayList<>();
                    for (int i = -k11[realk1]; i <= realk1; i++) {
                        a1.add(c[i].id);
                    }

                    ArrayList<Integer> a2 = new ArrayList<>();
                    for (int i = 0; i <= leftMink22[-k11[realk1] - 1].id; i++) {
                        a2.add(c[i].id);
                    }

                    if (swap) {
                        ArrayList<Integer> b = new ArrayList<>();
                        b.addAll(a1);
                        a1.clear();
                        a1.addAll(a2);
                        a2.clear();
                        a2.addAll(b);
                    }

                    out.println(a1.size() + " " + a2.size());
                    for (int i : a1)
                        out.print(i + 1 + " ");
                    out.println();
                    for (int i : a2)
                        out.print(i + 1 + " ");

                    // out.flush();
                    return;
                }
                if (realk1 < n - 1 && -rightMink22[realk1 + 1].c >= realk1 + 1 + k11[realk1]) {
                    out.println("Yes");

                    // out.println("2 " + realk1 + " " + (-k11[realk1]));
                    // out.println((realk1 + 1 + k11[realk1]) + " (" + (rightMink22[realk1 + 1].id + 1) + " - " + (realk1 + 1 + k11[realk1]) + ")");

                    ArrayList<Integer> a1 = new ArrayList<>();
                    for (int i = -k11[realk1]; i <= realk1; i++) {
                        a1.add(c[i].id);
                    }

                    ArrayList<Integer> a2 = new ArrayList<>();
                    for (int i = realk1 + 1; i <= rightMink22[realk1 + 1].id; i++) {
                        a2.add(c[i].id);
                    }
                    for (int i = 0; i < -k11[realk1]; i++) {
                        a2.add(c[i].id);
                    }

                    if (swap) {
                        ArrayList<Integer> b = new ArrayList<>();
                        b.addAll(a1);
                        a1.clear();
                        a1.addAll(a2);
                        a2.clear();
                        a2.addAll(b);
                    }

                    out.println(a1.size() + " " + a2.size());
                    for (int i : a1)
                        out.print(i + 1 + " ");
                    out.println();
                    for (int i : a2)
                        out.print(i + 1 + " ");

                    //out.flush();
                    return;
                }
            }
        }


        out.println("No");
    }

    void shuffle(Pair[] a) {
        Pair b;
        Random r = new Random();
        for (int i = a.length - 1, j; i > 0; i--) {
            j = r.nextInt(i + 1);
            b = a[j];
            a[j] = a[i];
            a[i] = b;
        }
    }

    void reverse(Pair[] a) {
        Pair b;
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            b = a[i];
            a[i] = a[j];
            a[j] = b;
        }
    }

    private void solveE() {

    }

    private void solveF() {

    }

    class FastScanner {
        StringTokenizer st;
        BufferedReader br;

        FastScanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        boolean hasNext() throws IOException {
            return br.ready() || (st != null && st.hasMoreTokens());
        }

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

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

        double nextDouble() throws IOException {
            return Double.parseDouble(next().replace(',', '.'));
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

        boolean hasNextLine() throws IOException {
            return br.ready();
        }

    }

    private void run() throws IOException {
        in = new FastScanner(System.in); // new FastScanner(new FileInputStream(".in"));
        out = new PrintWriter(System.out); // new PrintWriter(new FileOutputStream(".out"));

        solve();

        out.flush();
        out.close();
    }

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