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
from bisect import bisect_left
from bisect import bisect_right

n, m, cl, ce, v = map(int, raw_input().split())
l = map(int, raw_input().split())
e = map(int, raw_input().split())

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

    if x1 == x2:
        print abs(y2 - y1)
        continue

    k1 = n * m
    k2 = n * m

    if len(l) > 0:
        if y1 > l[0]:
            l1 = l[bisect_left(l, y1) - 1]
            k1 = abs(y1 - l1) + abs(l1 - y2)
        if y1 < l[-1]:
            l2 = l[bisect_right(l, y1)]
            k2 = abs(y1 - l2) + abs(l2 - y2)

    tl = abs(x2 - x1) + min(k1, k2)

    k1 = n * m
    k2 = n * m

    if len(e) > 0:
        if y1 > e[0]:
            e1 = e[bisect_left(e, y1) - 1]
            k1 = abs(y1 - e1) + abs(e1 - y2)
        if y1 < e[-1]:
            e2 = e[bisect_right(e, y1)]
            k2 = abs(y1 - e2) + abs(e2 - y2)

    te = int(math.ceil(abs(x2 - x1) / float(v))) + min(k1, k2)

    print min(tl, te)
