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
from bisect import bisect_left
def takeClosest(myList, myNumber):
    pos = bisect_left(myList, myNumber)
    if pos == 0:
        return myList[0]
    if pos == len(myList):
        return myList[-1]
    before = myList[pos - 1]
    after = myList[pos]
    if after - myNumber < myNumber - before:
        return after
    else:
        return before
n,m,cL,cE,v = map(float,raw_input().split()) 
inp_arr = []
if cL>0:
    stair_pos = map(float,raw_input().split()) 
else:
    g = raw_input()
if cE>0:
    elev_pos = map(float,raw_input().split()) 
else:
    d = raw_input()
q = int(raw_input())
for i in range(q):
    arr = map(float,raw_input().split()) 
    inp_arr.append(arr)
for i in inp_arr:
    x = 1000000000
    y = 1000000000
    if cL!=0:
        close_stair = takeClosest(stair_pos,i[3])
        x = abs(i[3]-close_stair)+abs(i[0]-i[2])+abs(close_stair-i[1])
    if cE!=0:
        close_elev = takeClosest(elev_pos,i[3])
        y = abs(i[3]-close_elev)+math.ceil(abs(i[0]-i[2])/v)+abs(close_elev-i[1])
    print min(int(x),int(y))