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

from math import ceil
from bisect import bisect_left

n, m, cl, ce, v = input().split(' ')
n, m, cl, ce, v = int(n), int(m), int(cl), int(ce), int(v)
cl_list, ce_list = [], []
if cl > 0:
    cl_list = [int(i) for i in input().split(' ')]
else:
    input()
if ce > 0:
    ce_list = [int(i) for i in input().split(' ')]
else:
    input()

query = int(input())
for i in range(0, query - 1):
    x1, y1, x2, y2 = input().split(' ')
    x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
    if x1 == x2:
        print(abs(y1 - y2))
    else:
        minlen = 200000000
        if cl > 0:
            pos = bisect_left(cl_list, y1)
            if pos < cl:
                minlen = min(minlen, abs(y1 - cl_list[pos]) + abs(y2 - cl_list[pos]) + abs(x1 - x2))
            if pos > 0:
                minlen = min(minlen, abs(y1 - cl_list[pos - 1]) + abs(y2 - cl_list[pos - 1]) + abs(x1 - x2))
        if ce > 0:
            pos = bisect_left(ce_list, y1)
            if pos < ce:
                minlen = min(minlen, abs(y1 - ce_list[pos]) + abs(y2 - ce_list[pos]) + ceil(abs(x1 - x2) / v))
            if pos > 0:
                minlen = min(minlen, abs(y1 - ce_list[pos - 1]) + abs(y2 - ce_list[pos - 1]) + ceil(abs(x1 - x2) / v))
        print(minlen)
