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 bisect as bs
import sys
inp = sys.stdin.readlines()
n, m, ladders, elevators, v = [int(x) for x in inp[0].strip().split()]
ladders = [int(x) for x in inp[1].strip().split()]
elevators = [int(x) for x in inp[2].strip().split()]
q = int(inp[3].strip())
qs = []
for i in range(q):
    qs.append([int(x) for x in inp[4+i].strip().split()])

output = []

for query in qs:
    x1, y1, x2, y2 = query
    if x1 == x2:
        output.append(abs(y1-y2))
        continue
    cur_ld = []
    if ladders and (y1 > ladders[0]):
        cur_ld.append(ladders[bs.bisect_left(ladders, y1)-1])
    if ladders and (y1 < ladders[-1]):
        cur_ld.append(ladders[bs.bisect_right(ladders, y1)])

    cur_elev = []
    if elevators and (y1 > elevators[0]):
        cur_elev.append(elevators[bs.bisect_left(elevators, y1)-1])
    if elevators and (y1 < elevators[-1]):
        cur_elev.append(elevators[bs.bisect_right(elevators, y1)])

    ans = []
    for lad in cur_ld:
        ans.append(abs(y1 - lad) + abs(y2 - lad) + abs(x1 - x2))
    for elev in cur_elev:
        height = abs(x1-x2)
        elspeed = height // v
        if height % v != 0: elspeed+=1
        ans.append(abs(y1 - elev) + abs(y2 - elev) + elspeed)
    ans = min(ans)
    output.append(ans)

output = '\n'.join(map(str, output))
print(output)