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

n, m, ncl, nce, v = map(int, raw_input().split())
cs = map(int, raw_input().split())
ce = map(int, raw_input().split())
q = int(raw_input())


##################

def cost(arr, index, y1, y2):
    if index >= len(arr):
        index = len(arr) - 1
    pos = arr[index]

    #print("pos=", pos, "y=", y1, y2)
    if pos <= y1:
        return (y2 - pos) + (y1 - pos)
    if pos <= y2:
        return y2 - y1
    return (pos - y2) + (pos - y1)

##################

def find_stairs(y1, y2, d):
    if len(cs) == 0:
        return 10e10
    if y1 > y2:
        t = y1
        y1 = y2
        y2 = t
    #print("y=", y1, y2, "d=", d, "cs=", cs)
    left = bisect_left(cs, y1)
    if left < len(cs):
        if cs[left] > y1 and left > 0:
            left -= 1
    middle = bisect_right(cs, y1)
    right = bisect_right(cs, y2)
    return d + min(cost(cs, left, y1, y2), min(cost(cs, middle, y1, y2), cost(cs, right, y1, y2)))

##################

def find_el(y1, y2, d):
    if len(ce) == 0:
        return 10e10
    if y1 > y2:
        t = y1
        y1 = y2
        y2 = t
    left = bisect_left(ce, y1)
    if left < len(cs):
        if cs[left] > y1 and left > 0:
            left -= 1
    middle = bisect_right(ce, y1)
    right = bisect_right(ce, y2)
    time_to_go = (d + v - 1) // v
    return time_to_go + min(cost(ce, left, y1, y2), min(cost(ce, middle, y1, y2), cost(ce, right, y1, y2)))

##################

def find(x1, y1, x2, y2):
    d = abs(x1 - x2)
    if d == 0:
        return abs(y1 - y2)
#    print("el=", find_el(y1, y2, d))
#    print("st=", find_stairs(y1, y2, d))
    return min(find_el(y1, y2, d), find_stairs(y1, y2, d))

for i in xrange(q):
    x1, y1, x2, y2 = map(int, raw_input().split())
    print(find(x1, y1, x2, y2))
