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.*;
import java.io.*;

public class Source {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int cl = Integer.parseInt(st.nextToken());
        int ce = Integer.parseInt(st.nextToken());
        int v = Integer.parseInt(st.nextToken());
        TreeSet<Integer>stairs = new TreeSet<>();
        TreeSet<Integer>elevator = new TreeSet<>();
        st = new StringTokenizer(br.readLine());
        for(int i = 1;i <= cl;i++){
            int a = Integer.parseInt(st.nextToken());
            stairs.add(a);
        }
        st = new StringTokenizer(br.readLine());
        for(int i = 1;i <= ce;i++){
            int a = Integer.parseInt(st.nextToken());
            elevator.add(a);
        }
        int q = Integer.parseInt(br.readLine());
        StringBuilder sb = new StringBuilder();
        for(int i = 1;i <= q;i++){
            st = new StringTokenizer(br.readLine());
            int x1 = Integer.parseInt(st.nextToken());
            int y1 = Integer.parseInt(st.nextToken());
            int x2 = Integer.parseInt(st.nextToken());
            int y2 = Integer.parseInt(st.nextToken());
            Integer stair_low = stairs.floor(y1);
            Integer stair_high = stairs.ceiling(y1);
            Integer elevator_low = elevator.floor(y1);
            Integer elevator_high = elevator.ceiling(y1);
            int ans = Integer.MAX_VALUE;
            if(stair_low != null){
                ans = Math.min(ans, Math.abs(y1 - stair_low) + Math.abs(x2 - x1) + Math.abs(y2 - stair_low));
            }
            if(stair_high != null){
                ans = Math.min(ans, Math.abs(y1 - stair_high) + Math.abs(x2 - x1) + Math.abs(stair_high - y2));
            }
            if(elevator_low != null){
                int cnt = Math.abs(x2 - x1) / v + (Math.abs(x2 - x1) % v == 0 ? 0 : 1);
                ans = Math.min(ans, Math.abs(y1 - elevator_low) + cnt + Math.abs(y2 - elevator_low));
            }
            if(elevator_high != null){
                int cnt = Math.abs(x2 - x1) / v + (Math.abs(x2 - x1) % v == 0 ? 0 : 1);
                ans = Math.min(ans, Math.abs(y1 - elevator_high) + cnt + Math.abs(y2 - elevator_high));
            }
            if(x1 == x2){
                ans = Math.min(ans, Math.abs(y1 - y2));
            }
            sb.append(ans);
            sb.append('\n');
        }
        System.out.println(sb);
    }
}
