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.Scanner;

public class Solution {
	int NumRow;
	int NumCol;
	int NumStrair;
	int NumLift;
	int speed;
	int stairs[];
	int lifts[];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Solution tr = new Solution();
		tr.test(sc);
		sc.close();
	}

	void test(Scanner sc){
		NumRow = sc.nextInt();
		NumCol = sc.nextInt();
		NumStrair = sc.nextInt();
		NumLift = sc.nextInt();
		speed = sc.nextInt();
		if(NumStrair > 0){
			stairs = new int[NumStrair];
			for (int i = 0; i < NumStrair; i++) {
				stairs[i] = sc.nextInt();
			}
		}

		if(NumLift > 0){
			lifts = new int[NumLift];
			for (int i = 0; i < NumLift; i++) {
				lifts[i] = sc.nextInt();
			}
		}
		int NumQry = sc.nextInt();
		for (int i = 0; i < NumQry; i++) {
			int sr = sc.nextInt();
			int scol = sc.nextInt();
			int er = sc.nextInt();
			int ec = sc.nextInt();
			int ans = find(sr, scol, er, ec);
			System.out.println(ans);
		}

	}
	int rank(int[] arr, int key){
		int lo = 0;
		int hi = arr.length-1;
		if(key < arr[0]){
			return -1;
		}
		if(key > arr[hi]){
			return hi;
		}

		while(lo <= hi){
			int mid = lo + (hi-lo)/2;
			if(key < arr[mid]) hi  = mid -1;
			else if(key > arr[mid]) lo = mid+1;
			else return mid;
		}
		return lo;
	}
	int find(int sr, int sc, int er, int ec){
		int ans = Integer.MAX_VALUE;
		if(NumStrair > 0){
			int leftstair = rank(stairs, sc);
			int rightstair = -1;
			if(leftstair != NumStrair-1){
				rightstair = leftstair+1;
			}

			if(leftstair != -1 && rightstair != -1){
				int lds =  Math.abs(sc - stairs[leftstair]);
				int rds =  Math.abs(stairs[rightstair] - sc);

				int lde = Math.abs(ec - stairs[leftstair]);
				int rde = Math.abs(stairs[rightstair] - ec);

				int floordiff =  Math.abs(er-sr);
				int ltime = lds+lde+floordiff;
				int rtime = rds+rde+floordiff;
				if(ltime < rtime){
					ans = ltime;
				}else{
					ans = rtime;
				}
			}

			if(leftstair == -1 && rightstair != -1){
				int rds =  Math.abs(stairs[rightstair] - sc);
				int rde = Math.abs(stairs[rightstair] - ec);
				int floordiff =  Math.abs(er-sr);
				int rtime = rds+rde+floordiff;
				ans = rtime;
			}

			if(leftstair != -1 && rightstair == -1){
				int lds =  Math.abs(sc - stairs[leftstair]);
				int lde = Math.abs(ec - stairs[leftstair]);
				int floordiff =  Math.abs(er-sr);
				int ltime = lds+lde+floordiff;
				ans = ltime;
			}
		}

		if(NumLift > 0){
			int leftstair = rank(lifts, sc);
			int rightstair = -1;
			if(leftstair != NumLift-1){
				rightstair = leftstair+1;
			}

			if(leftstair != -1 && rightstair != -1){
				int lds =  Math.abs(sc - lifts[leftstair]);
				int rds =  Math.abs(lifts[rightstair] - sc);

				int lde = Math.abs(ec - lifts[leftstair]);
				int rde = Math.abs(lifts[rightstair] - ec);

				int floordiff =  Math.abs(er-sr);

				int lifttime = floordiff/speed;
				if(floordiff%speed != 0){
					lifttime++;
				}
				int ltime = lds+lde+lifttime;
				int rtime = rds+rde+lifttime;
				if(ltime < rtime){
					if(ltime < ans)
						ans = ltime;
				}else{
					if(rtime < ans)
						ans = rtime;
				}
			}

			if(leftstair == -1 && rightstair != -1){
				int rds =  Math.abs(lifts[rightstair] - sc);
				int rde = Math.abs(lifts[rightstair] - ec);
				int floordiff =  Math.abs(er-sr);
				int lifttime = floordiff/speed;
				if(floordiff%speed != 0){
					lifttime++;
				}
				int rtime = rds+rde+lifttime;
				if(rtime < ans)
					ans = rtime;
			}

			if(leftstair != -1 && rightstair == -1){
				int lds =  Math.abs(sc - lifts[leftstair]);
				int lde = Math.abs(ec - lifts[leftstair]);
				int floordiff =  Math.abs(er-sr);
				int lifttime = floordiff/speed;
				if(floordiff%speed != 0){
					lifttime++;
				}
				int ltime = lds+lde+lifttime;
				if(ltime < ans)
					ans = ltime;
			}
		}

		return ans;

	}
}
