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

# python3
import sys
from bisect import bisect


def readline(): return tuple(map(int, input().split()))
def readlines():
    return (tuple(map(int, line.split())) for line in sys.stdin.readlines())


def bisect_bounds(arr, val):
    idx = bisect(arr, val)
    if idx: yield idx - 1
    if idx < len(arr): yield idx


class Minimizator:
    def __init__(self, value=float('inf')):
        self.value = value
    def eat(self, value):
        self.value = min(self.value, value)


def main():
    n, m, cl, ce, v = readline()
    l = readline()
    e = readline()
    assert len(l) == cl
    assert len(e) == ce
    q, = readline()

    answers = list()
    for (x1, y1, x2, y2) in readlines():
        if x1 == x2:
            answers.append(abs(y1 - y2))
        else:
            ans = Minimizator(n + 2*m)
            for idx in bisect_bounds(l, y1):
                ladder = l[idx]
                ans.eat(abs(x1 - x2) + abs(ladder - y1) + abs(ladder - y2))
            for idx in bisect_bounds(e, y1):
                elevator = e[idx]
                ans.eat((abs(x1 - x2) - 1) // v + 1
                        + abs(elevator - y1) + abs(elevator - y2))
            answers.append(ans.value)
    print("\n".join(map(str, answers)))


main()
