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 math import ceil
from bisect import bisect_left
input = __import__('sys').stdin.readline
MIS = lambda: map(int,input().split())

def walk(x1, y1, x2, y2, L, v):
    if not L: return abs(x2-x1) if y1 == y2 else float('inf')
    vertical = abs(y1-y2) if v == 1 else ceil(abs(y1-y2)/v)
    i = bisect_left(L, x1)
    
    xs1 = L[i-1] if 0<=i-1<len(L) else float('inf')
    xs2 = L[i] if 0<=i<len(L) else float('inf')
    xs3 = L[i+1] if 0<=i+1<len(L) else float('inf')
    d = min(abs(x1-xs1)+abs(xs1-x2), abs(x1-xs2)+abs(xs2-x2), abs(x1-xs3)+abs(xs3-x2))
    return d + vertical

n, m, cs, ce, v = MIS()
sta = list(MIS())
ele = list(MIS())
for TEST in range(int(input())):
    y1, x1, y2, x2 = MIS()
    if x1 > x2:
        x1, x2 = x2, x1
        y1, y2 = y2, y1
    print(min(walk(x1, y1, x2, y2, sta, 1), walk(x1, y1, x2, y2, ele, v)))
