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

public class Main
{
    static class Reader 
    { 
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} 
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];} 
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;} 
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();} 
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;} 
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;} 
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } 
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } 
    } 
    
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    public static void main(String args[])
    {
        Reader sc=new Reader();
        PrintWriter out=new PrintWriter(System.out);
        int n=sc.i();
        int m=sc.i();
        int cl=sc.i();
        int ce=sc.i();
        int v=sc.i();
        TreeSet<Integer> elevator=new TreeSet<Integer>();
        elevator.add(-1000000000);
        elevator.add(1000000000);
        
        TreeSet<Integer> stairs=new TreeSet<Integer>();
        stairs.add(-1000000000);
        stairs.add(1000000000);
        
        while(cl-->0)
        stairs.add(sc.i());
        while(ce-->0)
        elevator.add(sc.i());
        int q=sc.i();
        while(q-->0)
        {
            int x1=sc.i();int y1=sc.i();
            int x2=sc.i();int y2=sc.i();
            if(x1==x2)
            {
                System.out.println(Math.abs(y2-y1));
                System.exit(0);
            }
            int time=0;
            int arr[]=new int[8];
            int ele1=elevator.lower(y1);
            arr[0]=Math.abs(y1-ele1)+(int)(Math.ceil(Math.abs(x2-x1)*1.0/v))+Math.abs(y2-ele1);
            int ele2=elevator.higher(y1);
            arr[1]=Math.abs(y1-ele2)+(int)(Math.ceil(Math.abs(x2-x1)*1.0/v))+Math.abs(y2-ele2);
            
            int ele3=elevator.lower(y2);
            arr[2]=Math.abs(y2-ele3)+(int)(Math.ceil(Math.abs(x2-x1)*1.0/v))+Math.abs(y1-ele3);
            int ele4=elevator.higher(y2);
            arr[3]=Math.abs(y2-ele4)+(int)(Math.ceil(Math.abs(x2-x1)*1.0/v))+Math.abs(y1-ele4);
            
            
            int st1=stairs.lower(y1);
            arr[4]=Math.abs(y1-st1)+Math.abs(x2-x1)+Math.abs(y2-st1);
            int st2=stairs.higher(y1);
            arr[5]=Math.abs(y1-st2)+Math.abs(x2-x1)+Math.abs(y2-st2);
            
            int st3=stairs.lower(y2);
            arr[6]=Math.abs(y2-st3)+Math.abs(x2-x1)+Math.abs(y1-st3);
            int st4=stairs.higher(y2);
            arr[7]=Math.abs(y2-st4)+Math.abs(x2-x1)+Math.abs(y1-st4);
            Arrays.sort(arr);
            out.println(arr[0]);
        }
        out.flush();
    }
}