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

n, m, cl, ce, v = list(map(int, input().split()))

l = list(map(int, input().split()))
e = list(map(int, input().split()))

q = int(input())


def first_upper(a, x):
    if len(a) == 0:
        return None
    if a[0] >= x:
        return 0
    lo, hi = 0, len(a)
    while hi - lo > 1:
        mid = (lo + hi) // 2
        if a[mid] < x:
            lo = mid
        else:
            hi = mid
    if lo + 1 >= len(a):
        return None
    return lo + 1


def first_lower(a, x):
    result = first_upper(a, x)
    if result is None:
        if len(a) != 0:
            return len(a) - 1
        else:
            return None
    if 0 <= result - 1 < len(a):
        return result - 1
    return None


def query(x1, y1, x2, y2):
    if x1 == x2:
        return abs(y1 - y2)
    result = 1000000000000000000
    next_stair = first_upper(l, x1)
    if next_stair is not None:
        result = min(result, abs(l[next_stair] - y1) + abs(l[next_stair] - y2) + abs(x1 - x2))
    prev_stair = first_lower(l, x1)
    if prev_stair is not None:
        result = min(result, abs(l[prev_stair] - y1) + abs(l[prev_stair] - y2) + abs(x1 - x2))
    next_elevator = first_upper(e, x1)
    if next_elevator is not None:
        result = min(result, abs(e[next_elevator] - y1) + abs(e[next_elevator] - y2) + math.ceil(abs(x1 - x2) / v))
    prev_elevator = first_lower(e, x1)
    if prev_elevator is not None:
        result = min(result, abs(e[prev_elevator] - y1) + abs(e[prev_elevator] - y2) + math.ceil(abs(x1 - x2) / v))
    return result


for i in range(q):
    x1, y1, x2, y2 = list(map(int, input().split()))
    print(query(x1, y1, x2, y2))