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 __future__ import division, print_function
import bisect
import math
import itertools
import sys
from atexit import register

if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream


if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip


def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def main():
    n,m,c1,ce,v=map(int,input().split())
    posstairs=list(map(int,input().split()))
    posele=list(map(int,input().split()))
    q=int(input())
    for i in range(0,q):
        y1,x1,y2,x2=map(int,input().split())
        if x2<x1:
            x1,x2=x2,x1
        if ce!=0:
            ind1=bisect.bisect_left(posele,x1)
            if ind1==ce:
                ind1-=1
            t1=abs(x1-posele[ind1])+abs(posele[ind1]-x2)+math.ceil(abs(y2-y1)/v)
            ind1-=1
            if ind1>=0:
                t1=min(t1,abs(x1-posele[ind1])+abs(posele[ind1]-x2)+math.ceil(abs(y2-y1)/v))
        if c1!=0:
            ind3=bisect.bisect_left(posstairs,x1)
            if ind3==c1:
                ind3-=1
            t2=abs(x1-posstairs[ind3])+abs(posstairs[ind3]-x2)+abs(y2-y1)
            ind3-=1
            if ind3>=0:
                t2=min(t2,abs(x1-posstairs[ind3])+abs(posstairs[ind3]-x2)+abs(y2-y1))
        if y1==y2:
            print(abs(x2-x1))
        elif ce!=0 and c1!=0:
            print(min(t1,t2))
        elif ce!=0:
            print(t1)
        else :
            print(t2)
if __name__ == '__main__':
    sync_with_stdio(False)
    main()