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

n, m, s, e, v = [int(x) for x in input().split()]

stairs = sorted(int(x) for x in input().split())
elevs = sorted(int(x) for x in input().split())

from math import ceil
from bisect import bisect_left, bisect_right

for _ in range(int(input())):
    x1, y1, x2, y2 = [int(x) for x in input().split()]
    
    if x1 > x2: x1, x2 = x2, x1
    if y1 > y2: y1, y2 = y2, y1
    
    diffx = x2 - x1
    diffy = y2 - y1
    
    res = float('inf')
    
    s2 = bisect_right(stairs, y2)
    s1 = bisect_right(stairs, y1-1)
    e2 = bisect_right(elevs, y2)
    e1 = bisect_right(elevs, y1-1)
    
    if e2 > e1:
        res = int(ceil(diffx / v))
    elif s2 > s1:
        res = diffx
    
    closests = m
    if s2 < len(stairs):
        closests = min(closests, stairs[s2] - y2)
    if s2:
        closests = min(closests, y2 - stairs[s2-1])
    
    closeste = m
    if e2 < len(elevs):
        closeste = min(closeste, elevs[e2] - y2)
    if e2:
        closeste = min(closeste, y2 - elevs[e2-1])
    
    if s1 < len(stairs):
        closests = min(closests, stairs[s1] - y1)
    if s1:
        closests = min(closests, y1 - stairs[s1-1])
    
    if e1 < len(elevs):
        closeste = min(closeste, elevs[e1] - y1)
    if e1:
        closeste = min(closeste, y1 - elevs[e1-1])
    
    res = min(res, closests * 2 + diffx)
    res = min(res, closeste * 2 + int(ceil(diffx / v)))
    
    print(res + diffy)
