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();
			
			if(x2 > y2) {
				if(l.length > 0) {
					lsec = binarySearch(l, 0, l.length-1, x2, -1);
					ltime = Math.abs(x2-lsec) + Math.abs(x1-y1) + Math.abs(y2-lsec);
				}
				if(e.length > 0) {
					esec = binarySearch(e, 0, e.length-1, x2, -1);
					etime = Math.abs(x2-esec) 
							+ (Math.abs(x1-y1) % v == 0 ? Math.abs(x1 - y1) / v : (Math.abs(x1-y1) / v) + 1)
							+ Math.abs(y2-esec);
				}
				
			}
			else {
				if(l.length > 0) {
					lsec = binarySearch(l, 0, l.length-1, x2, 1);
					ltime = Math.abs(x2-lsec) + Math.abs(x1-y1) + Math.abs(y2-lsec);
				}
				if(e.length > 0) {
					esec = binarySearch(e, 0, e.length-1, x2, 1);
					etime = Math.abs(x2-esec) 
							+ (Math.abs(x1-y1) % v == 0 ? Math.abs(x1 - y1) / v : (Math.abs(x1-y1) / v) + 1) 
							+ Math.abs(y2-esec);			
				}
				
			}
			System.out.println(Math.min(ltime, etime));
			
		}
		sc.close();
		
	}

	private static int binarySearch(int[] a, int low, int high, int ele, int dir) {
		
		int mid = low + (high-low)/2;
		if(low < high) {
//			System.out.println("low = " + a[low] + ", mid = "+ a[mid] + ", high = " + a[high]);
			if(a[mid] == ele)		return ele;
			if(a[mid] < ele)		return binarySearch(a, mid+1, high, ele, dir);
			return binarySearch(a, low, mid-1, ele, dir);
		}
		
		if(a[low] > ele) {
			
			if(low-1 >= 0) {
				if(Math.abs(a[low-1] - ele) == Math.abs(a[low]-ele)) {
					if(dir < 0) {
						return a[low-1];
					}
					else {
						return a[low];
					}
				}
				return (Math.abs(a[low-1] - ele) < Math.abs(a[low]-ele)) ?  a[low-1] : a[low];
			}
			else
				return a[low];
		}
		else if(a[low] < ele) {
			if(high + 1 <= a.length-1) {
				if(Math.abs(a[high+1] - ele) == Math.abs(a[high]-ele)) {
					if(dir > 0)	{
						return a[high+1];
					}
					else {
						return a[high];
					}
				}
				return (Math.abs(a[high+1] - ele) < Math.abs(a[high]-ele)) ?  a[high+1] : a[high];
			}
			else {
				return a[high];
			}
		}
		else {
			return a[mid];
		}
		
	}
	
}
//2 2 0 1 1
//
//1
//1
//1 2 2 2