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 math

INF = 1e12

num_floors, num_sections, num_stairs, num_elevators, max_speed = (int(x) for x in input().split())

stairs = [int(x) for x in input().split()]
elevators = [int(x) for x in input().split()]

neg_stairs = [-x for x in reversed(stairs)]
neg_elevators = [-x for x in reversed(elevators)]

num_queries = int(input())

def answer_query(x1, y1, x2, y2):
    elevator_path = best_elevator_path(x1, y1, x2, y2)
    stair_path = best_stair_path(x1, y1, x2, y2)
    print(min(elevator_path, stair_path))

def best_elevator_path(x1, y1, x2, y2):
    left_elevator_id = left_bound(elevators, x1)
    left_elevator = elevators[left_elevator_id] if left_elevator_id is not None else INF

    right_elevator_id = left_bound(neg_elevators, -x2)
    right_elevator = elevators[num_elevators - 1 - right_elevator_id] if right_elevator_id is not None else -INF
    
    closest_distance = min(distance(x1, x2, elevator) for elevator in (left_elevator, right_elevator))
    vertical_time = abs(y2-y1)//max_speed if (y2-y1) % max_speed == 0 else math.ceil(abs(y2 - y1)/max_speed)
    return abs(x2 - x1) + 2*closest_distance + vertical_time

def best_stair_path(x1, y1, x2, y2):
    left_stair_id = left_bound(stairs, x1)
    left_stair = stairs[left_stair_id] if left_stair_id is not None else INF

    right_stair_id = left_bound(neg_stairs, -x2)
    right_stair = stairs[num_stairs - 1 -right_stair_id] if right_stair_id is not None else -INF

    closest_distance = min(distance(x1, x2, stair) for stair in (left_stair, right_stair))
    return abs(x2 - x1) + 2*closest_distance + abs(y2 - y1)

def distance(x1, x2, p):
    if x1 <= p <= x2:
        return 0
    else:
        return min(abs(x1 - p), abs(x2 - p))

#find first element greater or equal to x (return None if none)
def left_bound(arr, value):
    lower_bound = 0
    upper_bound = len(arr)
    middle = None
    while lower_bound != upper_bound:
        middle = (lower_bound + upper_bound) // 2
        # print(arr[middle], value)
        if arr[middle] < value:
            lower_bound = middle + 1
        else:
            upper_bound = middle
    middle = lower_bound
    # print(arr, value, middle)
    return middle if middle != len(arr) else None

def right_bound(arr, value):
    lower_bound = 0
    upper_bound = len(arr)
    while lower_bound != upper_bound:
        middle = (lower_bound + upper_bound) // 2
        if arr[middle] > value:
            upper_bound = middle
        else:
            lower_bound = middle + 1

    return middle if middle != 0 else None

for _ in range(num_queries):
    y1, x1, y2, x2 = (int(y) for y in input().split())
    answer_query(x1, y1, x2, y2)

