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

/**
 * Timur
 * 0:32  21.04.2018
 */
public class wild {
    final static Double EPS = 10E-6;
    private static Scanner sc = new Scanner(System.in);

    private static int min(int a, int b) {
        return a > b ? b : a;
    }

    private static int min(int[] a) {
        int min = Integer.MAX_VALUE;
        for (int i : a) {
            min = min > i ? i : min;
        }
        return min;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for (int i : a) {
            max = max < i ? i : max;
        }
        return max;
    }

    private static void in(int[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
    }

    private static void in(long[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextLong();
        }
    }

    private static void out(int[] a) {
        for (int i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(int[][] a) {
        for (int[] ar : a) {
            out(ar);
        }
    }

    private static long phi(long n) {
        long result = n;
        for (long i = 2; i * i <= n; ++i)
            if (n % i == 0) {
                while (n % i == 0)
                    n /= i;
                result -= result / i;
            }
        if (n > 1)
            result -= result / n;
        return result;
    }

    private static long gdc(long a, long b) {
        while (a * b > 0) {
            if (a > b) {
                a %= b;
            } else {
                b %= a;
            }
        }
        return a + b;
    }

    public static void main(String[] args) {
//        long arr[] = new long[]{1, 2, 3, 4, 5, 33};
//        System.out.println(-(Arrays.binarySearch(arr, 36) + 1));
        int n = sc.nextInt();
        int m = sc.nextInt();
        int cl = sc.nextInt();
        int ce = sc.nextInt();
        int vel = sc.nextInt();
        int[] lest = new int[cl];
        int[] elev = new int[ce];
        for (int i = 0; i < cl; i++) {
            lest[i] = sc.nextInt();
        }
        for (int i = 0; i < ce; i++) {
            elev[i] = sc.nextInt();
        }
        int q = sc.nextInt();
        for (int i = 0; i < q; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            int x1 = sc.nextInt();
            int y1 = sc.nextInt();
            int timeElev = 0;
            if (x1 == x) {
                System.out.println(Math.abs(y - y1));
            } else {
                if (ce > 0) {
                    int closestElev = -(Arrays.binarySearch(elev, y) + 1);
                    if (closestElev == 0) {
                        timeElev += Math.abs(y - elev[closestElev]);
                        timeElev += Math.abs(x - x1) % vel == 0 ? Math.abs(x - x1) / vel : Math.ceil(Math.abs(x - x1) * 1.0 / vel);
                        timeElev += Math.abs(y1 - elev[closestElev]);
                    } else {
                        if (closestElev == elev.length) {
                            closestElev--;
                            timeElev += Math.abs(y - elev[closestElev]);
                            timeElev += Math.abs(x - x1) % vel == 0 ? Math.abs(x - x1) / vel : Math.ceil(Math.abs(x - x1) * 1.0 / vel);
                            timeElev += Math.abs(y1 - elev[closestElev]);
                        } else {
//                            if (Math.abs(y - elev[closestElev - 1]) < Math.abs(y - elev[closestElev])) {
//                                closestElev--;
//                            }
                            int timeelev1 = 0;
                            timeelev1 += Math.abs(y - elev[closestElev - 1]);
                            timeelev1 += Math.abs(x - x1) % vel == 0 ? Math.abs(x - x1) / vel : Math.ceil(Math.abs(x - x1) * 1.0 / vel);
                            timeelev1 += Math.abs(y1 - elev[closestElev - 1]);

                            timeElev += Math.abs(y - elev[closestElev]);
                            timeElev += Math.abs(x - x1) % vel == 0 ? Math.abs(x - x1) / vel : Math.ceil(Math.abs(x - x1) * 1.0 / vel);
                            timeElev += Math.abs(y1 - elev[closestElev]);
                            timeElev = Math.min(timeElev, timeelev1);
                        }
                    }
                } else {
                    timeElev = 2 * (n + m);
                }
                int timeLes = 0;
                if (cl > 0) {
                    int closestLes = -(Arrays.binarySearch(lest, y) + 1);
                    if (closestLes == 0) {
                        timeLes += Math.abs(y - lest[closestLes]);
                        timeLes += Math.abs(x - x1);
                        timeLes += Math.abs(y1 - lest[closestLes]);
                    } else {
                        if (closestLes == lest.length) {
                            closestLes--;
                            timeLes += Math.abs(y - lest[closestLes]);
                            timeLes += Math.abs(x - x1);
                            timeLes += Math.abs(y1 - lest[closestLes]);
                        } else {
//                            if (Math.abs(y - lest[closestLes - 1]) < Math.abs(y - lest[closestLes])) {
//                                closestLes--;
//                            }
                            int timeles1 = 0;
                            timeles1 += Math.abs(y - lest[closestLes - 1]);
                            timeles1 += Math.abs(x - x1);
                            timeles1 += Math.abs(y1 - lest[closestLes - 1]);

                            timeLes += Math.abs(y - lest[closestLes]);
                            timeLes += Math.abs(x - x1);
                            timeLes += Math.abs(y1 - lest[closestLes]);
                            timeLes = Math.min(timeles1, timeLes);
                        }
                    }
                } else {
                    timeLes = 2 * (n + m);
                }
                System.out.println(Math.min(timeElev, timeLes));
            }
        }
    }
}