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;

/**
 * Created by makarfi on 4/29/18.
 */
public class C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt(), m = in.nextInt(),
                numStairs = in.nextInt(), numElevators = in.nextInt(), elevatorSpeed = in.nextInt();

        int[] stairs = new int[numStairs+1];
        for (int i = 1; i < stairs.length; i++) stairs[i] = in.nextInt();

        int[] elevators = new int[numElevators+1];
        for (int i = 1; i < elevators.length; i++) elevators[i] = in.nextInt();

        StringBuilder ans = new StringBuilder();
        int Q = in.nextInt();
        while (Q-- > 0) {
            int x1 = in.nextInt(), y1 = in.nextInt(), x2 = in.nextInt(), y2 = in.nextInt();
            int yMin = Math.min(y1, y2), yMax = Math.max(y1, y2), x = Math.abs(x1-x2);

            //consider same floor
            if (x == 0) {
                ans.append(yMax - yMin).append("\n");
                continue;
            }

            int stairsToYMin = Arrays.binarySearch(stairs, 1, stairs.length, yMin);
            if (stairsToYMin < 0) stairsToYMin = Math.abs(stairsToYMin + 1);

            long stairDist = Integer.MAX_VALUE;

            if (stairsToYMin < stairs.length && stairs[stairsToYMin] < yMax) {
                stairDist = yMax - yMin;
            } else {
                if (stairsToYMin < stairs.length) {
                    stairDist = Math.min(stairDist, (stairs[stairsToYMin] - yMax) * 2 + (yMax - yMin));
                }
                if (stairsToYMin > 1) {
                    stairDist = Math.min(stairDist, (yMin - stairs[stairsToYMin - 1]) * 2 + (yMax - yMin));
                }
            }

            int elevatorToYMin = Arrays.binarySearch(elevators, 1, elevators.length, yMin);
            if (elevatorToYMin < 0) elevatorToYMin = Math.abs(elevatorToYMin + 1);

            long elevatorDist = Integer.MAX_VALUE;

            if (elevatorToYMin < elevators.length && elevators[elevatorToYMin] < yMax) {
                elevatorDist = yMax - yMin;
            } else {
                if (elevatorToYMin < elevators.length) {
                    elevatorDist = Math.min(elevatorDist, (elevators[elevatorToYMin] - yMax) * 2 + (yMax - yMin));
                }
                if (elevatorToYMin > 1) {
                    elevatorDist = Math.min(elevatorDist, (yMin - elevators[elevatorToYMin - 1]) * 2 + (yMax - yMin));
                }
            }

            long best = Math.min(stairDist + (x), elevatorDist + ((x-1)/elevatorSpeed) + 1);
            ans.append(best).append("\n");
        }

        System.out.print(ans);
    }
}
