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 

n, m, cl, ce, v = list(map(int,input().split()))
l = list(map(int,input().split()))
e = list(map(int,input().split()))
q = int(input())

for i in range(0,q):
  A = list(map(int,input().split()))
  p = m*n
  if A[0] == A[2]:
    p = abs(A[1]-A[3])
  else:
    #checking paths by elevator
    closest_elevator_left = 0
    for k in range(1, A[1]):
      if A[1]-k in e:
        closest_elevator_left = A[1]-k
        break
    if closest_elevator_left != 0:
      c = abs(A[1]-closest_elevator_left) + math.ceil(abs(A[0]-A[2])/v) + abs(A[3]-closest_elevator_left)
      if c <= p:
        p = c
        
    closest_elevator_right = 0    
    for k in range(1, m-A[1]):
      if A[1]+k in e:
        closest_elevator_right = A[1]+k
        break
    if closest_elevator_right != 0:  
      c = abs(A[1]-closest_elevator_right) + math.ceil(abs(A[0]-A[2])/v) + abs(A[3]-closest_elevator_right)
      if c <= p:
        p = c
      
    #checking paths by stairs
    closest_stairs_left = 0
    for k in range(1, A[1]):
      if A[1]-k in l:
        closest_stairs_left = A[1]-k
        break
    if closest_stairs_left != 0:
      c = (A[1]-closest_stairs_left) + abs(A[0]-A[2]) + abs(A[3]-closest_stairs_left)
      if c <= p:
        p = c
    
    closest_stairs_right = 0
    for k in range(1, m-A[1]):
      if A[1]+k in l:
        closest_stairs_right = A[1]+k
        break
    if closest_stairs_right != 0:
        c = (closest_stairs_right - A[1]) + abs(A[0]-A[2]) + abs(A[3]-closest_stairs_right)
        if c <= p:
          p = c
    

    
   
 
      
  print(p)

    