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

n,  m, cl, ce, v = map(int, input().split())

stairs = [int(x) for x in input().split()]
elevators = [int(x) for x in input().split()]

for _ in range(int(input())):
    x1, y1, x2, y2 = map(int, input().split())
    q = abs(x2-x1)+abs(y2-y1)
    if y2 == y1:
        r = y1
        l = y1
        qr = 0
        ql = 0
        for i in range(m):
            if r in stairs:
                qr = abs(x1-x2)+abs(2*(y2-r))
                break
            else:
                r = r+1
            if l in stairs:
                ql = abs(x1-x2)+abs(2*(y2-l))
                break
            else:
                l = l-1
        if l>r:
            q = qr
        else:
            q = ql           
    for i in elevators:
        if y1<i<y2 or y1>i>y2:
            q1 = abs(y2-y1) +  abs(ceil((x2-x1)/v))
            if q1 < q:
                q = q1
            break
    print(q)