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.util.TreeSet;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.ni(), m = in.ni(), cl = in.ni(), ce = in.ni(), v = in.ni();
            TreeSet<Integer> l = new TreeSet<>();
            TreeSet<Integer> e = new TreeSet<>();

            for (int i = 0; i < cl; i++) {
                l.add(in.ni() - 1);
            }
            for (int i = 0; i < ce; i++) {
                e.add(in.ni() - 1);
            }


            int q = in.ni();
            for (int i = 0; i < q; i++) {
                int x = in.ni() - 1, y = in.ni() - 1, xt = in.ni() - 1, yt = in.ni() - 1;

                int ans = Integer.MAX_VALUE;
                if (x == xt) {
                    ans = Math.abs(yt - y);
                } else {
                    Integer leftl = l.lower(y);
                    Integer lefte = e.lower(y);
                    Integer rightl = l.higher(y);
                    Integer righte = e.higher(y);
                    if (leftl != null) {
                        ans = Math.min(ans, y - leftl + Math.abs(xt - x) + Math.abs(yt - leftl));
                    }
                    if (rightl != null) {
                        ans = Math.min(ans, rightl - y + Math.abs(xt - x) + Math.abs(yt - rightl));
                    }
                    if (lefte != null) {
                        ans = Math.min(ans, y - lefte + Math.abs(xt - x) / v + (Math.abs(xt - x) % v == 0 ? 0 : 1) + Math.abs(yt - lefte));
                    }
                    if (righte != null) {
                        ans = Math.min(ans, righte - y + Math.abs(xt - x) / v + (Math.abs(xt - x) % v == 0 ? 0 : 1) + Math.abs(yt - righte));
                    }
                }
                out.println(ans);
            }
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(ns());
        }

    }
}

