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 java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;

public class Watermelon {
//    static int n;
    static HashMap<Integer,ArrayList<Integer>> map=new HashMap<>();
    static int[] dfs,tin,tout,color,par;
    static long[] count;
    static int t=0;
    public static void main(String[] args) throws IOException {
        Reader sc=new Reader();
        int n=sc.nextInt(),m=sc.nextInt(),cl=sc.nextInt(),ce=sc.nextInt(),v=sc.nextInt();
        int[] clar=new int[cl],cear=new int[ce];
        for(int i=0;i<cl;i++) clar[i]=sc.nextInt();
        for(int i=0;i<ce;i++) cear[i]=sc.nextInt();
        int q=sc.nextInt();
//        System.out.println(q+" q");
        for(int i=0;i<q;i++){
            int x1=sc.nextInt(),y1=sc.nextInt(),x2=sc.nextInt(),y2= sc.nextInt();
            index=-1;
            ans=Integer.MAX_VALUE;
            binarySearch(clar,0,cl-1,y1,cl);
            int indexcly1=index;
            index=-1;
            ans=Integer.MAX_VALUE;
            binarySearch(clar,0,cl-1,y2,cl);
            int indexcly2=index;
            index=-1;
            ans=Integer.MAX_VALUE;
            binarySearch(cear,0,ce-1,y1,ce);
            int indexcey1=index;
            index=-1;
            ans=Integer.MAX_VALUE;
            binarySearch(cear,0,ce-1,y2,ce);
            int indexcey2=index;
//            System.out.println(y1+" "+indexcey1+" "+y2+" "+((int)(Math.ceil(((float)Math.abs(x2-x1))/v))));
//            System.out.println(y1+" "+indexcey2+" "+y2+" "+((int)(Math.ceil(((float)Math.abs(x2-x1))/v))));
//            System.out.println(y1+" "+indexcly2+" "+y2+" "+((int)(Math.ceil(((float)Math.abs(x2-x1))/v))));
            int anscey1=Math.abs(y1-indexcey1)+(int)(Math.ceil(((float)Math.abs(x2-x1))/v))+Math.abs(indexcey1-y2);
            int anscey2=Math.abs(y1-indexcey2)+(int)(Math.ceil(((float)Math.abs(x2-x1))/v))+Math.abs(indexcey2-y2);
            int anscly1=Math.abs(y1-indexcly1)+(x2-x1)+Math.abs(indexcly1-y2);
            int anscly2=Math.abs(y1-indexcly2)+(x2-x1)+Math.abs(indexcly2-y2);
//            System.out.println(anscey1+" "+anscey2+" "+anscly1+" "+anscly2+" "+x1+" "+x2);
            System.out.println(Math.min(Math.min(Math.min(anscey1,anscey2),anscly1),anscly2));
        }
    }
    static int ans=Integer.MAX_VALUE;
    static int index=-1;
    static int binarySearch(int arr[], int l, int r, int x,int n)
    {
        if (r>=l && l<n && r<n)
        {
            int mid = l + (r - l)/2;
//            System.out.println(l+" "+r);
            // If the element is present at the
            // middle itself
//            System.out.println(arr[mid]+" "+ans);
            if(ans>Math.abs(arr[mid]-x)){
//                System.out.println(ans+" ans arrmid "+arr[mid]);
                  index=arr[mid];
                  ans=Math.abs(arr[mid]-x);
            }
            // If element is smaller than mid, then
            // it can only be present in left subarray
            if (arr[mid] > x)
                return binarySearch(arr, l, mid-1, x,n);

            // Else the element can only be present
            // in right subarray
            return binarySearch(arr, mid+1, r, x,n);
        }

        // We reach here when element is not present
        //  in array
        return -1;
    }
        static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }
}

