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 R4 {

    public static void main(String... xxx)
    {
        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[] al = new int[cl];
        int[] ae = new int[ce];
        for (int i = 0; i < cl; i++) {
            al[i] = sc.nextInt() - 1;
        }
        for (int i = 0; i < ce; i++) {
            ae[i] = sc.nextInt() - 1;
        }
        int q = sc.nextInt();
        for (int i = 0; i < q; i++) {
            int x1 = sc.nextInt() - 1, y1 = sc.nextInt() - 1, x2 = sc.nextInt() - 1, y2 = sc.nextInt() - 1;
            int dif = Math.abs(x1 - x2);
            int l = 0;

            if(cl != 0){
                int closy1 = search(y1, al);
                int closy2 = search(y2, al);
                l = Math.min(
                        (Math.abs(y1 -closy1) + dif + Math.abs(y2 - closy1)),
                        (Math.abs(y1 - closy2) + dif + Math.abs(y2 - closy2)));
            }
            else l = Integer.MAX_VALUE;
            int e = 0;
            if(ce != 0){
                int closy1 = search(y1, ae);
                int closy2 = search(y2, ae);
                e = Math.min(
                        (Math.abs(y1 - closy1) + (dif%v == 0 ? dif/v : dif/v + 1) + Math.abs(y2 - closy1)),
                        (Math.abs(y1 - closy2) + (dif%v == 0 ? dif/v : dif/v + 1) + Math.abs(y2 - closy2)));
            }
            else e = Integer.MAX_VALUE;
            int ans = Math.min(l, e);
            System.out.println(ans);
        }
        return;
    }

    public static int search(int value, int[] a) {

        if(value < a[0]) {
            return a[0];
        }
        if(value > a[a.length-1]) {
            return a[a.length-1];
        }

        int lo = 0;
        int hi = a.length - 1;

        while (lo <= hi) {
            int mid = (hi + lo) / 2;

            if (value < a[mid]) {
                hi = mid - 1;
            } else if (value > a[mid]) {
                lo = mid + 1;
            } else {
                return a[mid];
            }
        }
        // lo == hi + 1
        return (a[lo] - value) < (value - a[hi]) ? a[lo] : a[hi];
    }
}
