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.util.*;
public class A_GENERAL {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int m = sc.nextInt();
		int cl = sc.nextInt();
		int ce = sc.nextInt();
		int v = sc.nextInt();
		int[] l = new int[cl];
		int[] e = new int[ce];
		
		for(int i = 0; i < cl; i++) {
			l[i] = sc.nextInt();
		}
		for(int i = 0; i < ce; i++) {
			e[i] = sc.nextInt();
		}
		int q = sc.nextInt();
		int ltime = Integer.MAX_VALUE;
		int etime = Integer.MAX_VALUE;
		int lsec = 0;
		int esec = 0;
	
		while(q-- > 0) {
			
			int x1 = sc.nextInt();
			int x2 = sc.nextInt();
			int y1 = sc.nextInt(); 
			int y2 = sc.nextInt();
			int min = Integer.MAX_VALUE;
			int lbig = -Arrays.binarySearch(l, x2)-1;
			int lsmall = lbig-1;
			int ebig = -Arrays.binarySearch(e, x2)-1;
			int esmall = ebig-1;
			
			if(x1 == y1) {
				min = Math.abs(x1-y1);
			}
			if(lsmall >= 0) {
				min = Math.min(min, Math.abs(x2-l[lsmall]) + Math.abs(x1-y1) + Math.abs(y2-l[lsmall]));
			}
			if(lbig <= l.length-1) {
				min = Math.min(min, Math.abs(x2-l[lbig]) + Math.abs(x1-y1) + Math.abs(y2-l[lbig]));
			}
			if(esmall >= 0) {
				min = Math.min(min, Math.abs(x2-e[esmall] + (Math.abs(x1-y1)+v-1)/v) + Math.abs(y2-e[esmall]));
			}
			if(ebig <= e.length-1) {
				min = Math.min(min, Math.abs(x2-e[ebig]) + ((Math.abs(x1-y1)+v-1)/v) + Math.abs(y2-e[ebig]));
			}			
			
			System.out.println(min);
		}
			
		sc.close();
		
	}
	
}
//2 2 0 1 1
//
//1
//1
//1 2 2 2


//10 100 7 9 3
//5
//1 11 7 30