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

import math
import sys
try:
    int_max = 3000000
    n,m,cl,ce,v = map(int, input().split())
    stairs = list(map(int,input().split()))
    elevators = list(map(int,input().split()))
    q = int(input())
    for _ in range(q):
        x1,y1,x2,y2 = map(int,input().split())
        yl,yr = min(y1,y2),max(y1,y2)
        s,l = int_max,int_max
        if cl != 0:
            lsi = -1 #left stair index
            rsi = -1
            for i in range(cl):
                if stairs[i] < yl:
                    lsi = i
                if stairs[i] < yr:
                    rsi = i
                    break
            if cl == 1 or (lsi == 0 and rsi == 0):
                s = math.fabs(yr - stairs[0])+math.fabs(stairs[0] - yl)+math.fabs(x1-x2)
            elif lsi == m-1 and rsi == m-1:
                s = math.fabs(yr - stairs[-1])+math.fabs(stairs[-1] - yl)+math.fabs(x1-x2)
            elif lsi == rsi:
                s1 = math.fabs(yr - stairs[lsi])+math.fabs(stairs[lsi] - yl)+math.fabs(x1-x2)
                s2 = math.fabs(yr - stairs[lsi+1])+math.fabs(stairs[lsi+1] - yl)+math.fabs(x1-x2)
                s = min(s1, s2)
            else: #lsi < rsi
                s1 = math.fabs(yr - stairs[lsi])+math.fabs(stairs[lsi] - yl)+math.fabs(x1-x2)
                s2 = math.fabs(yr - stairs[lsi+1])+math.fabs(stairs[lsi+1] - yl)+math.fabs(x1-x2)
                s3 = math.fabs(yr - stairs[rsi])+math.fabs(stairs[rsi] - yl)+math.fabs(x1-x2)
                s4 = int_max if rsi == m-1 else math.fabs(yr - stairs[rsi+1])+math.fabs(stairs[rsi+1] - yl)+math.fabs(x1-x2)
                s = min(s1,s2,s3,s4)
        if ce != 0:
            lei = -1
            rei = -1
            for i in range(ce):
                if elevators[i] < yl:
                    lei = i
                if elevators[i] < yr:
                    rei = i
                    break
            if ce == 1 or (lei == 0 and rei == 0):
                l = math.fabs(yr - elevators[0])+math.fabs(elevators[0] - yl)+math.fabs(x1-x2)/v
            elif lei == m-1 and rei == m-1:
                l = math.fabs(yr - elevators[-1])+math.fabs(elevators[-1] - yl)+math.fabs(x1-x2)/v
            elif lei == rei:
                l1 = math.fabs(yr - elevators[lei])+math.fabs(elevators[lei] - yl)+math.fabs(x1-x2)/v
                l2 = math.fabs(yr - elevators[lei+1])+math.fabs(elevators[lei+1] - yl)+math.fabs(x1-x2)/v
                l = min(s1, s2)
            else: #lsi < rsi
                l1 = math.fabs(yr - elevators[lei])+math.fabs(elevators[lei] - yl)+math.fabs(x1-x2)/v
                l2 = math.fabs(yr - elevators[lei+1])+math.fabs(elevators[lei+1] - yl)+math.fabs(x1-x2)/v
                l3 = math.fabs(yr - elevators[rei])+math.fabs(elevators[rei] - yl)+math.fabs(x1-x2)/v
                l4 = int_max if rsi == m-1 else math.fabs(yr - elevators[rei+1])+math.fabs(elevators[rei+1] - yl)+math.fabs(x1-x2)/v
                l = min(s1,s2,s3,s4)
    print(math.ceil(min(s,l)))
except RuntimeError:
    print("Error")