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

// practice with kaiboy
import java.io.*;
import java.util.*;

public class CF967C extends PrintWriter {
	CF967C() { super(System.out); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF967C o = new CF967C(); o.main(); o.flush();
	}

	int search(int[] aa, int n, int a) {
		int lower = -1, upper = n;
		while (upper - lower > 1) {
			int i = (lower + upper) / 2;
			if (aa[i] <= a)
				lower = i;
			else
				upper = i;
		}
		return lower;
	}
	void main() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int cl = sc.nextInt();
		int ce = sc.nextInt();
		int v = sc.nextInt();
		int[] ll = new int[cl];
		for (int h = 0; h < cl; h++)
			ll[h] = sc.nextInt() - 1;
		int[] ee = new int[ce];
		for (int h = 0; h < ce; h++)
			ee[h] = sc.nextInt() - 1;
		int q = sc.nextInt();
		while (q-- > 0) {
			int i1 = sc.nextInt() - 1;
			int j1 = sc.nextInt() - 1;
			int i2 = sc.nextInt() - 1;
			int j2 = sc.nextInt() - 1;
			int di = Math.abs(i1 - i2);
			int dj = Math.abs(j1 - j2);
			if (di == 0) {
				println(dj);
				continue;
			}
			int ans = m + n + m;
			int h = search(ll, cl, j1);
			for (int h_ = h; h_ <= h + 1; h_++)
				if (0 <= h_ && h_ < cl) {
					int j = ll[h_];
					ans = Math.min(ans, Math.abs(j1 - j) + di + Math.abs(j - j2));
				}
			int div = (di + v - 1) / v;
			h = search(ee, ce, j1);
			for (int h_ = h; h_ <= h + 1; h_++)
				if (0 <= h_ && h_ < ce) {
					int j = ee[h_];
					ans = Math.min(ans, Math.abs(j1 - j) + div + Math.abs(j - j2));
				}
			println(ans);
		}
	}
}
