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 __future__ import division
from sys import stdin, stdout
from collections import *
from bisect import *

rstr = lambda: stdin.readline().strip()
rstrs = lambda: [str(x) for x in stdin.readline().split()]
rstr_2d = lambda n: [rstr() for _ in range(n)]
rint = lambda: int(stdin.readline())
rints = lambda: [int(x) for x in stdin.readline().split()]
rint_2d = lambda n: [rint() for _ in range(n)]
rints_2d = lambda n: [rints() for _ in range(n)]
pr = lambda args, sep: stdout.write(sep.join(map(str, args)) + '\n')
ceil1, out = lambda a, b: (a + b - 1) // b, []

n, m, cl, ce, v = rints()
l, e, q = rints(), rints(), rint()
qur = rints_2d(q)

for x1, y1, x2, y2 in qur:
    if x1 == x2:
        out.append(abs(y2 - y1))
    else:
        ans = float('inf')
        right = bisect_left(l, y1)
        if right < cl:
            ans = min(ans, abs(x2 - x1) + abs(l[right] - y1) + abs(l[right] - y2))

        if right - 1 > -1:
            right -= 1
            ans = min(ans, abs(x2 - x1) + abs(l[right] - y1) + abs(l[right] - y2))

        right = bisect_left(e, y1)
        if right < ce:
            ans = min(ans, ceil1(abs(x2 - x1), v) + abs(e[right] - y1) + abs(e[right] - y2))

        if right - 1 > -1:
            right -= 1
            ans = min(ans, ceil1(abs(x2 - x1), v) + abs(e[right] - y1) + abs(e[right] - y2))
        out.append(ans)

pr(out, '\n')
