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 UJP {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		int cl = in.nextInt();
		int ce = in.nextInt();
		int v = in.nextInt();
		int[] l = new int[cl];
		for (int i = 0; i < cl; i++)
			l[i] = in.nextInt();
		int[] e = new int[ce];
		for (int i = 0; i < ce; i++)
			e[i] = in.nextInt();
		int q = in.nextInt();
		while (q > 0) {
			q--;
			int x1 = in.nextInt();
			int y1 = in.nextInt();
			int x2 = in.nextInt();
			int y2 = in.nextInt();
			x1 = (int)First(y1, y1 = x1);
			x2 = (int)First(y2, y2 = x2);
			int ans = (int)1e9;
			if (y1 == y2) ans = Math.abs(x1 - x2);
			else {
				int left = -1, right = cl;
				while (left < right - 1) {
					int mid = (left + right) / 2;
					if (l[mid] < x1) left = mid;
					else right = mid;
				}
				if (left != -1) {
					ans = Math.min(ans, Math.abs(x1 - l[left]) + Math.abs(y1 - y2)
					+ Math.abs(x2 - l[left]));
				}
				if (right != cl) {
					ans = Math.min(ans, Math.abs(x1 - l[right]) + Math.abs(y1 - y2)
					+ Math.abs(x2 - l[right]));
				}
				left = -1;
				right = ce;
				while (left < right - 1) {
					int mid = (left + right) / 2;
					if (e[mid] < x1) left = mid;
					else right = mid;
				}
				if (left != -1) {
					ans = Math.min(ans, Math.abs(x1 - e[left]) + (Math.abs(y1 - y2) + v - 1) / v
					+ Math.abs(x2 - e[left]));
				}
				if (right != ce) {
					ans = Math.min(ans, Math.abs(x1 - e[right]) + (Math.abs(y1 - y2) + v - 1) / v
					+ Math.abs(x2 - e[right]));
				}
			}
			out.println(ans);
		}
		out.close();
	}
	
	public static Object First(Object a, Object b) {
		return a;
	}
	
	public static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

        public String nextString() {
            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(nextString());
        }
        
        public long nextLong() {
        	return Long.parseLong(nextString());
        }
        
        public double nextDouble() {
        	return Double.parseDouble(nextString());
        }
    }
}
