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.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Solution {

    private static class Point {
        public final int x;
        public final int y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
    
    private static final boolean DEBUG = false;

    private static int solve(int[] stairColumns, int[] elevatorColumns, int elevatorSpeed, Point from, Point to) {
        int minResult = Integer.MAX_VALUE;
        for (int i = 0; i < stairColumns.length; i++) {
            int result = Math.abs(from.y - stairColumns[i])
                    + Math.abs(to.y - stairColumns[i])
                    + Math.abs(to.x - from.x);
            if (result < minResult) minResult = result;
        }
        for (int i = 0; i < elevatorColumns.length; i++) {
            int result = Math.abs(from.y - elevatorColumns[i])
                    + Math.abs(to.y - elevatorColumns[i])
                    + (Math.abs(to.x - from.x) + 1 + elevatorSpeed - 1) / elevatorSpeed;
            if (result < minResult) minResult = result;
        }
        return minResult;
    }

    public static void main(String[] args) throws FileNotFoundException {
        long beginTime = System.nanoTime();
        InputStream is = DEBUG ? new FileInputStream("resources/codeforces477/ProblemC-1.in") : System.in;
        try (Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(is)))) {
            int rowCount = scanner.nextInt();
            int columnCount = scanner.nextInt();
            int stairCount = scanner.nextInt();
            int elevatorCount = scanner.nextInt();
            int elevatorSpeed = scanner.nextInt();
            int[] stairColumns = new int[stairCount];
            int[] elevatorColumns = new int[elevatorCount];
            for (int i = 0; i < stairColumns.length; i++) stairColumns[i] = scanner.nextInt();
            for (int i = 0; i < elevatorColumns.length; i++) elevatorColumns[i] = scanner.nextInt();
            int queryCount = scanner.nextInt();
            for (int i = 0; i < queryCount; i++) {
                Point from = new Point(scanner.nextInt(), scanner.nextInt());
                Point to = new Point(scanner.nextInt(), scanner.nextInt());
                int result = solve(stairColumns, elevatorColumns, elevatorSpeed, from, to);
                System.out.println(result);
            }
        }
        System.err.println( "Done in " + ((System.nanoTime() - beginTime) / 1e9) + " seconds.");
    }
}