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

n, m, s, e, v = [int(i) for i in raw_input().split(' ')]

tmp = raw_input()
ls = [int(i) for i in tmp.split(' ')] if tmp else []
tmp = raw_input()
le = [int(i) for i in tmp.split(' ')] if tmp else []

q = input()

ques = [[int(i) for i in raw_input().split(' ')] for j in range(q)]


def g(a, list1):
    length = len(list1)
    low = list1[0]
    high = length - 1
    mid = (low + high) / 2
    if len(list1) <= 2 or a >= list1[high - 1]:
        return high
    if a <= list1[low]:
        return low
    while not list1[mid - 1] <= a <= list1[mid]:
        if a > list1[mid]:
            low = mid
        else:
            high = mid
        mid = (low + high) / 2
    return mid


def f(qi):
    y1, x1, y2, x2 = qi
    if le:
        if len(le) == 1:
            de_x = abs(le[0] - x1) + abs(le[0] - x2)
        else:
            i = g(x1, le)
            de_x = min(abs(le[i] - x1) + abs(le[i] - x2), abs(le[i - 1] - x1) + abs(le[i - 1] - x2))
        de = de_x + (abs(y1 - y2) + v - 1) / v
    else:
        de = float("inf")

    if ls:
        if len(ls) == 1:
            ds_x = abs(ls[0] - x1) + abs(ls[0] - x2)
        else:
            i = g(x1, ls)
            ds_x = min(abs(ls[i] - x1) + abs(ls[i] - x2), abs(ls[i - 1] - x1) + abs(ls[i - 1] - x2))
        ds = ds_x + abs(y1 - y2)
    else:
        ds = float("inf")
    return min(de, ds)


for que in ques:
    print f(que)
