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 R477C2 {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int m=scan.nextInt();
		int stairs=scan.nextInt(), elev=scan.nextInt(), speed=scan.nextInt();

		int[] s=new int[stairs];
		int[] e=new int[elev];
		for(int i=0;i<stairs;i++) s[i]=scan.nextInt();
		for(int i=0;i<elev;i++) e[i]=scan.nextInt();

		int q=scan.nextInt();
		for(int i=0;i<q;i++) {
			int i1=scan.nextInt(), j1=scan.nextInt()-1;
			int i2=scan.nextInt(), j2=scan.nextInt()-1;
			int res=Integer.MAX_VALUE;
			if(i1==i2) res=Math.abs(j1-j2);
			
			for(int j=0;j<stairs;j++) {
				res=Math.min(res,Math.abs(j1-s[j])+Math.abs(i1-i2)+Math.abs(j2-s[j]));
			}
			for(int j=0;j<elev;j++) {
				res=Math.min(res,Math.abs(j1-e[j])+(int)Math.ceil(Math.abs(i1-i2)*1.0/speed)+Math.abs(j2-e[j]));
			}
			System.out.println(res);
		}
	}
}