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.util.*;

public class Main implements Runnable {
    static ContestScanner in;
    static Writer out;
    public static void main(String[] args) {
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();
    }

    public void run() {
        Main main = new Main();
        try {
            in = new ContestScanner();
            out = new Writer();
            main.solve();
            out.close();
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    void solve() throws IOException {
        // attention!!! x <-> y
        int n = in.nextInt();
        int m = in.nextInt();
        int cl = in.nextInt();
        int ce = in.nextInt();
        int v = in.nextInt();
        int[] stair = new int[cl];
        int[] elev = new int[ce];
        for (int i = 0; i < cl; i++) {
            stair[i] = in.nextInt();
        }
        for (int i = 0; i < ce; i++) {
            elev[i] = in.nextInt();
        }
        int q = in.nextInt();
        int[] stack = new int[100];
        int p;
        for (int i = 0; i < q; i++) {
            int r1 = in.nextInt();
            int c1 = in.nextInt();
            int r2 = in.nextInt();
            int c2 = in.nextInt();
            p = 0;
            int ans = Integer.MAX_VALUE;
            if (cl > 0) {
                int s = Arrays.binarySearch(stair, c1);
                if (s == -1) {
                    stack[p++] = stair[0];
                } else if (s == -cl - 1) {
                    stack[p++] = stair[cl - 1];
                } else {
                    stack[p++] = stair[-s - 1];
                    stack[p++] = stair[-s - 2];
                }
            }
            for (int j = 0; j < p; j++) {
                ans = Math.min(ans, getLen(r1, c1, r2, c2, stack[j], 1));
            }
            p = 0;
            if (ce > 0) {
                int s = Arrays.binarySearch(elev, c1);
                if (s == -1) {
                    stack[p++] = elev[0];
                } else if (s == -ce - 1) {
                    stack[p++] = elev[ce - 1];
                } else {
                    stack[p++] = elev[-s - 1];
                    stack[p++] = elev[-s - 2];
                }
            }
            for (int j = 0; j < p; j++) {
                ans = Math.min(ans, getLen(r1, c1, r2, c2, stack[j], v));
            }
            out.println(ans);
        }
    }

    int getLen(int r1, int c1, int r2, int c2, int sp, int v) {
        return Math.abs(c1 - sp) + Math.abs(c2 - sp) + (Math.abs(r1 - r2) + v - 1) / v;
    }
}

class Writer extends PrintWriter{
    public Writer(String filename)throws IOException
    {super(new BufferedWriter(new FileWriter(filename)));}
    public Writer()throws IOException {super(System.out);}
}
class ContestScanner implements Closeable {
    private BufferedReader in;private int c=-2;
    public ContestScanner()throws IOException
    {in=new BufferedReader(new InputStreamReader(System.in));}
    public ContestScanner(String filename)throws IOException
    {in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
    public String nextToken()throws IOException {
        StringBuilder sb=new StringBuilder();
        while((c=in.read())!=-1&&Character.isWhitespace(c));
        while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public String readLine()throws IOException{
        StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
        while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public long nextLong()throws IOException,NumberFormatException
    {return Long.parseLong(nextToken());}
    public int nextInt()throws NumberFormatException,IOException
    {return(int)nextLong();}
    public double nextDouble()throws NumberFormatException,IOException
    {return Double.parseDouble(nextToken());}
    public void close() throws IOException {in.close();}
}
