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.*;
import java.util.*;

public class C implements Runnable{
	public static void main (String[] args) {new Thread(null, new C(), "_cf", 1 << 28).start();}

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		int n = fs.nextInt();
		int m = fs.nextInt();
		int cl = fs.nextInt();
		int ce = fs.nextInt();
		int v = fs.nextInt();
		int[] stairs = new int[cl];
		for(int i = 0; i < cl; i++) stairs[i] = fs.nextInt();
		int[] elev = new int[ce];
		for(int i = 0; i < ce; i++) elev[i] = fs.nextInt();
		
		TreeSet<Integer> stairSet = new TreeSet<>();
		TreeSet<Integer> elevSet = new TreeSet<>();
		for(int i : stairs) stairSet.add(i);
		for(int i : elev) elevSet.add(i);
		
		int q = fs.nextInt();
		long[] costs = new long[4];
		long oo = (long)1e18;
		Integer[] work = new Integer[4];
		while(q-->0) {
			int x1 = fs.nextInt(), y1 = fs.nextInt();
			int x2 = fs.nextInt(), y2 = fs.nextInt();
			if(x1 == x2) {
				out.println(Math.abs(x1 - x2));
				continue;
			}
			if(x1 < x2) {
				int tx1 = x1; int ty1 = y1;
				x1 = x2; y1 = y2;
				x2 = tx1; y2 = ty1;
			}

			Arrays.fill(costs, oo);
			Arrays.fill(work, null);
			work[0] = elevSet.lower(y1);
			work[1] = elevSet.higher(y1);
			work[2] = stairSet.lower(y1);
			work[3] = stairSet.higher(y1);
			for(int i = 0; i < 4; i++) {
				if(work[i] == null) continue;
				long c = Math.abs(work[i] - y1);
				if(i < 2) {
					c += (x1 - x2) / v + ((x1 - x2) % v > 0 ? 1 : 0);
				}
				else {
					c += x1 - x2;
				}
				c += Math.abs(work[i]-y2);
				costs[i] = c;
			}
			long res = oo;
			for(int i = 0; i < 4; i++) res=  Math.min(res, costs[i]);
			out.println(res);
		}
		
		out.close();
	}

	void sort (int[] a) {
		int n = a.length;
		for(int i = 0; i < 50; i++) {
			Random r = new Random();
			int x = r.nextInt(n), y = r.nextInt(n);
			int temp = a[x];
			a[x] = a[y];
			a[y] = temp;
		}
		Arrays.sort(a);
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}