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.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static int N, M, V, Q;
	public static int[] stairs, elevators;

	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(f.readLine());
		st.nextToken();
		st.nextToken();
		N = Integer.parseInt(st.nextToken());
		M = Integer.parseInt(st.nextToken());
		V = Integer.parseInt(st.nextToken());
		stairs = new int[N + 4];
		elevators = new int[M + 4];
		st = new StringTokenizer(f.readLine());
		for (int i = 0; i < N; i++) {
			stairs[i] = Integer.parseInt(st.nextToken());
		}
		st = new StringTokenizer(f.readLine());
		for (int i = 0; i < M; i++) {
			elevators[i] = Integer.parseInt(st.nextToken());
		}
		for (int i = N; i < N + 2; i++) {
			stairs[i] = -1000000000;
			elevators[i] = -1000000000;
		}
		for (int i = N + 2; i < N + 4; i++) {
			stairs[i] = 1000000000;
			elevators[i] = 1000000000;
		}
		Arrays.sort(stairs);
		Arrays.sort(elevators);
		Q = Integer.parseInt(f.readLine());
		StringBuilder sb = new StringBuilder();
		for (int iter = 0; iter < Q; iter++) {
			st = new StringTokenizer(f.readLine());
			int y1 = Integer.parseInt(st.nextToken());
			int x1 = Integer.parseInt(st.nextToken());
			int y2 = Integer.parseInt(st.nextToken());
			int x2 = Integer.parseInt(st.nextToken());
			if (y1 == y2) {
				sb.append(Math.abs(x1 - x2)).append("\n");
			} else {
				int res = Integer.MAX_VALUE;
				int stairIndex1 = -Arrays.binarySearch(stairs, x1) - 1;
				int leftStair1 = stairs[stairIndex1 - 1];
				int rightStair1 = stairs[stairIndex1];
				res = Math.min(res, Math.abs(x1 - leftStair1) + Math.abs(y1 - y2) + Math.abs(x2 - leftStair1));
				res = Math.min(res, Math.abs(x1 - rightStair1) + Math.abs(y1 - y2) + Math.abs(x2 - rightStair1));
				int elevatorIndex1 = -Arrays.binarySearch(elevators, x1) - 1;
				int leftelevator1 = elevators[elevatorIndex1 - 1];
				int rightelevator1 = elevators[elevatorIndex1];
				int dis = Math.abs(y1 - y2) / V;
				if (Math.abs(y1 - y2) % V != 0)
					dis++;
				res = Math.min(res, Math.abs(x1 - leftelevator1) + dis + Math.abs(x2 - leftelevator1));
				res = Math.min(res, Math.abs(x1 - rightelevator1) + dis + Math.abs(x2 - rightelevator1));
				int stairIndex2 = -Arrays.binarySearch(stairs, x2) - 1;
				int leftStair2 = stairs[stairIndex2 - 1];
				int rightStair2 = stairs[stairIndex2];
				res = Math.min(res, Math.abs(x1 - leftStair2) + Math.abs(y1 - y2) + Math.abs(x2 - leftStair2));
				res = Math.min(res, Math.abs(x1 - rightStair2) + Math.abs(y1 - y2) + Math.abs(x2 - rightStair2));
				int elevatorIndex2 = -Arrays.binarySearch(elevators, x2) - 1;
				int leftelevator2 = elevators[elevatorIndex2 - 1];
				int rightelevator2 = elevators[elevatorIndex2];
				res = Math.min(res, Math.abs(x1 - leftelevator2) + dis + Math.abs(x2 - leftelevator2));
				res = Math.min(res, Math.abs(x1 - rightelevator2) + dis + Math.abs(x2 - rightelevator2));
				sb.append(res).append("\n");
			}
		}
		System.out.print(sb.toString());
	}
}