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.InputStream;
import java.lang.*;
import java.util.*;
public class fan_chipu {
	
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long n = input.nextLong();
		long m = input.nextLong();
		long tb = input.nextLong();
		long tm = input.nextLong();
		long v = input.nextLong();
		long a[] = new long[123456];
		long b[] = new long[123456];
		for(int i = 1;i <= tb;++i) a[i] = input.nextLong();
		for(int i = 1;i <= tm;++i) b[i] = input.nextLong();
		a[0] = -1234567890;
		a[(int)tb + 1] = 1234567890;
		b[0] = -1234567890;
		b[(int)tm + 1] = 1234567890;
		Arrays.sort(a, 1,1 + (int)tb);
		Arrays.sort(b, 1,1 + (int)tm);
		long q = input.nextLong();
		long ans = 0;
		while(q-- > 0) {
			long y1 = input.nextLong();
			long x1 = input.nextLong();
			long y2 = input.nextLong();
			long x2 = input.nextLong();
			int ll = 1,rr = (int)tb + 1;
			int ii = (ll + rr)>>1;
			while(ll != ii && ii != rr) {
				if(a[ii] <= x1) ll = ii;
				else rr = ii;
				ii = (ll + rr)>>1;
			}
			for(int i = ll;i <= rr;++i) if(a[i] > x1) {
				ii = i;
				break;
			}
//			System.out.println(ii + "uu");
			long cb = Math.min(a[ii] - x1 + Math.abs(x2 - a[ii]), - a[ii - 1] + x1 + Math.abs(x2 - a[ii - 1]));
			ll = 1;rr = (int)tm + 1;ii = (ll + rr) >> 1;
			while(ll != ii && ii != rr) {
				if(b[ii] > x1) rr = ii;
				else ll = ii;
				ii = (ll + rr)>>1;
			}
			for(int i = ll;i <= rr;++i) if(b[i] > x1) {
				ii = i;
				break;
			}
			long cm = Math.min(b[ii] - x1 + Math.abs(x2 - b[ii]), - b[ii - 1] + x1 + Math.abs(x2 - b[ii - 1]));
//			System.out.println(cb + " " + cm + " " + ii);
			ans = Math.min(cb + Math.abs(y1 -y2),cm + ((Math.abs(y1 - y2) + v - 1) / v));
			System.out.println(ans);
		}
		input.close();
	}
}