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.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;


public class D {

    long MODULO = 1L * 1000 * 1000 * 1000 * 1000 * 1000 ;
    long b = 31;
    String fileName = "";
    class Point{
        int x, y;
        Point(int x, int y){
            this.x = x;
            this.y = y;
        }
    }

    //////////////////////    SOLUTION   SOLUTION  SOLUTION    //////////////////////////////
    int INF = Integer.MAX_VALUE;
    class Otv implements Comparable<Otv>{
        int val, ind;
        Otv(int ind, int val){
            this.ind = ind;
            this.val = val;
        }

        @Override
        public int compareTo(Otv o) {
            return this.val - o.val;
        }
    }
    void solve() throws IOException {
        int n = readInt();
        int m = readInt();

        int countLest = readInt();
        int countLift = readInt();
        int v = readInt();
        int[] lests = readIntArray(countLest);
        int[] lifts = readIntArray(countLift);
        int q = readInt();

        while(q-- > 0){
            int x1 = readInt();
            int y1 = readInt();
            int x2 = readInt();
            int y2 = readInt();
            if(y2 < y1){
                int e = y1;
                y1 = y2;
                y2 = e;
            }
            if(x1 == x2){
                out.println(y2 - y1);
                continue;
            }
            int leftLift = binSearchLeft(lifts, y1);
            int rightLift = binSearchRight(lifts, y1);
            int leftLest = binSearchLeft(lests, y1);
            int rightLest = binSearchRight(lests, y1);
            int t1 = INF;
            int t2 = INF;
            int t3 = INF;
            int t4 = INF;
            int height = Math.abs(x1 - x2);
            if(leftLest != -1){
                t1 = (y1 - leftLest) * 2 + height + y2 - y1;
            }
            if(leftLift != -1){
                t2 = (y1 - leftLest) * 2 + (height / v + (int)Math.signum(height % v)) + y2 - y1;
            }
            if(rightLest != INF){
                if(rightLest <= y2){
                    t3 = height + y2 - y1;
                }else{
                    t3 = height + y2 - y1 + (rightLest - y2) * 2;
                }
            }
            if(rightLift != INF){
                if(rightLift <= y2){
                    t4 = (height / v + (int)Math.signum(height % v)) + y2 - y1;
                }else{
                    t4 = (height / v + (int)Math.signum(height % v)) + y2 - y1 + (rightLift - y2) * 2;
                }
            }
            //out.println(rightLest);
            //out.println(t1 +" "+t2 +" "+t3 +" "+t4);
            out.println(Math.min(Math.min(t1, t2), Math.min(t3, t4)));
        }

    }

    ///////////////////////////////////////////////////////////////////////////////////////////
    int binSearchRight(int[] a, int val){
        int l = -1;
        int r = a.length;
        while(r - l > 1){
            int mid = (r+l)/2;
            if(a[mid] >= val){
                r = mid;
            }else{
                l = mid;
            }
        }
        return r == a.length ? INF :a[r];
    }
    int binSearchLeft(int[] a, int val){
        int l = -1;
        int r = a.length;
        while(r - l > 1){
            int mid = (r+l)/2;
            if(a[mid] <= val){
                l = mid;
            }else{
                r = mid;
            }
        }
        return l == -1 ? -1 : a[l];
    }
    class SparseTable{
        int[][] rmq;
        int[] logTable;
        int n;
        SparseTable(int[] a){
            n = a.length;
            logTable = new int[n+1];
            for(int i = 2; i <= n; ++i){
                logTable[i] = logTable[i >> 1] + 1;
            }
            rmq = new int[logTable[n] + 1][n];
            for(int i=0; i<n; ++i){
                rmq[0][i] = a[i];
            }

            for(int k=1; (1 << k) < n; ++k){
                for(int i=0; i + (1 << k) <= n; ++i){
                    int max1 = rmq[k - 1][i];
                    int max2 = rmq[k-1][i + (1 << (k-1))];
                    rmq[k][i] = Math.max(max1, max2);
                }
            }
        }

        int max(int l, int r){
            int k = logTable[r - l];
            int max1 = rmq[k][l];
            int max2 = rmq[k][r - (1 << k) + 1];
            return Math.max(max1, max2);
        }
    }
    long checkBit(long mask, int bit){
        return (mask >> bit) & 1;
    }
    class Dsu{
        int[] parent;
        int countSets;
        Dsu(int n){
            countSets = n;
            parent = new int[n];
            for(int i=0; i<n; ++i){
                parent[i] = i;
            }
        }
        int findSet(int a){
            if(parent[a] == a) return a;
            parent[a] = findSet(parent[a]);
            return parent[a];
        }
        void unionSets(int a, int b){
            a = findSet(a);
            b = findSet(b);
            if(a!=b){
                countSets--;
                parent[a] = b;
            }
        }
    }
    static int checkBit(int mask, int bit) {
        return (mask >> bit) & 1;
    }
    boolean isLower(char c){
        return c >= 'a' && c <= 'z';
    }

    ////////////////////////////////////////////////////////////
    class Pair implements Comparable<Pair>{
        int ind,val;
        Pair(int a, int b){
            this.ind = a;
            this.val = b;
        }

        @Override
        public int compareTo(Pair o) {
            return this.val - o.val;
        }
    }
    class SegmentTree{
        int[] t;
        int n;
        SegmentTree(int n){
            t = new int[4*n];
            build(new int[n+1], 1, 1, n);
        }
        void build (int a[], int v, int tl, int tr) {
            if (tl == tr)
                t[v] = a[tl];
            else {
                int tm = (tl + tr) / 2;
                build (a, v*2, tl, tm);
                build (a, v*2+1, tm+1, tr);
            }
        }

        void update (int v, int tl, int tr, int l, int r, int add) {
            if (l > r)
                return;
            if (l == tl && tr == r)
                t[v] += add;
            else {
                int tm = (tl + tr) / 2;
                update (v*2, tl, tm, l, Math.min(r,tm), add);
                update (v*2+1, tm+1, tr, Math.max(l,tm+1), r, add);
            }
        }

        int get (int v, int tl, int tr, int pos) {
            if (tl == tr)
                return t[v];
            int tm = (tl + tr) / 2;
            if (pos <= tm)
                return t[v] + get (v*2, tl, tm, pos);
            else
                return t[v] + get (v*2+1, tm+1, tr, pos);
        }
    }
    class Fenwik {
        long[] t;
        int length;

        Fenwik(int[] a) {
            length = a.length + 100;
            t = new long[length];

            for (int i = 0; i < a.length; ++i) {
                inc(i, a[i]);
            }
        }

        void inc(int ind, int delta) {
            for (; ind < length; ind = ind | (ind + 1)) {
                t[ind] += delta;
            }
        }

        long getSum(int r) {
            long sum = 0;
            for (; r >= 0; r = (r & (r + 1)) - 1) {
                sum += t[r];
            }
            return sum;
        }
    }
    int gcd(int a, int b){
        return b == 0 ? a : gcd(b, a%b);
    }

    long binPow(long a, long b, long m) {
        if (b == 0) {
            return 1;
        }
        if (b % 2 == 1) {
            return ((a % m) * (binPow(a, b - 1, m) % m)) % m;
        } else {
            long c = binPow(a, b / 2, m);
            return (c * c) % m;
        }

    }
    int minInt(int... values) {
        int min = Integer.MAX_VALUE;
        for (int value : values) min = Math.min(min, value);
        return min;
    }

    int maxInt(int... values) {
        int max = Integer.MIN_VALUE;
        for (int value : values) max = Math.max(max, value);
        return max;
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new D().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    };

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";
    Random rnd = new Random();

    D() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }
    byte readByte() throws NumberFormatException, IOException {
        return Byte.parseByte(readString());
    }
    int[] readIntArray (int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    Integer[] readIntegerArray (int n) throws NumberFormatException, IOException {
        Integer[] a = new Integer[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}



/*
        for(long k = 1; k <= 100; k++){
            for(long l=1; l<=100; ++l){
                int stupidAns = 0;
                long n = l, m = k;
                while(m*n > 0){
                    stupidAns += m * n;
                    m--;
                    n--;
                }
                n = l; m = k;
                if(m > n){
                    long v = m;
                    m = n;
                    n = v;
                }
                long p = n * m;
                BigInteger b1 = BigInteger.valueOf((1 + (m - 1)) * (m - 1) / 2);
                BigInteger b2 = BigInteger.valueOf(p - (n-1) * (m - 1));
                BigInteger b3 = b1.multiply(b2);
                BigInteger b4 = BigInteger.valueOf(p);
                BigInteger b5 = BigInteger.valueOf(m);
                b5 = b5.multiply(b4);
                BigInteger b6 = BigInteger.valueOf((1 + (m - 2)) * (m - 2));
                b5 = b5.subtract(b3);
                b5 = b5.add(b6);
                long diff = ((1 + (m - 1)) * (m - 1)/ 2) * ( p - (n-1) * (m - 1));
                long diff2 = (1 + (m - 2)) * (m - 2);

                if(!b5.toString().equals(stupidAns+"")){
                    out.println(l + " " + k +" " + stupidAns + " " + b5.toString());
                }
            }
        }
 */