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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {

	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);	
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt(), m = scan.nextInt(), cl = scan.nextInt(), ce = scan.nextInt(), v = scan.nextInt();
		int[] s = new int[cl];
		int[] e = new int[ce];
		for(int i = 0; i < cl; i++) s[i] = scan.nextInt();
		for(int i = 0; i < ce; i++) e[i] = scan.nextInt();
		int q = scan.nextInt();
		while(q --> 0) {
			int x1 = scan.nextInt(), y1 = scan.nextInt(), x2 = scan.nextInt(), y2 = scan.nextInt();
			long dx = Math.abs(x1-x2), dy = Math.abs(y1-y2);
			if(x1 == x2) {
				out.println(dy);
				continue;
			}
			long res1 = 0x3f3f3f3f3f3f3f3fL;
			if(ce > 0) {
				int lo = 0, hi = ce-1;
				for(int bs = 0; bs < 50; bs++) {
					int mid = (lo+hi)>>1;
					if(e[mid] >= y1) lo = mid;
					else hi = mid;
				}
				for(int i = Math.max(0, lo-3); i <= Math.min(ce-1, lo+3); i++) res1 = Math.abs(e[i]-y1)+(dx/v+(dx%v==0?0:1))+Math.abs(e[i]-y2);
			}
			long res2 = 0x3f3f3f3f3f3f3f3fL;
			if(cl > 0) {
				int lo2 = 0, hi2 = cl-1;
				for(int bs = 0; bs < 50; bs++) {
					int mid = (lo2+hi2)>>1;
					if(s[mid] >= y1) lo2 = mid;
					else hi2 = mid;
				}
				for(int i = Math.max(0, lo2-3); i <= Math.min(cl-1, lo2+3); i++) res2 = Math.abs(s[i]-y1)+dx+Math.abs(s[i]-y2);
			}
			out.println(Math.min(res1, res2));
		}
		out.close();
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

		public int nextInt() {return Integer.parseInt(next());}

		public long nextLong() {return Long.parseLong(next());}

		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}


}