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 Solution 
{
    static class InputReader
	{
	    private final InputStream stream;
	    private final byte[] buf = new byte[8192];
	    private int curChar, snumChars;
 
	    public InputReader(InputStream st) {
	      this.stream = st;
	    }
 
	    public int read() {
	      if (snumChars == -1)
	        throw new InputMismatchException();
	      if (curChar >= snumChars) {
	        curChar = 0;
	        try {
	          snumChars = stream.read(buf);
	        } catch (IOException e) {
	          throw new InputMismatchException();
	        }
	        if (snumChars <= 0)
	          return -1;
	      }
	      return buf[curChar++];
	    }
 
	    public int nextInt() {
	      int c = read();
	      while (isSpaceChar(c)) {
	        c = read();
	      }
	      int sgn = 1;
	      if (c == '-') {
	        sgn = -1;
	        c = read();
	      }
	      int res = 0;
	      do {
	        res *= 10;
	        res += c - '0';
	        c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }
 
	    public long nextLong() {
	      int c = read();
	      while (isSpaceChar(c)) {
	        c = read();
	      }
	      int sgn = 1;
	      if (c == '-') {
	        sgn = -1;
	        c = read();
	      }
	      long res = 0;
	      do {
	        res *= 10;
	        res += c - '0';
	        c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }
 
	    public int[] nextIntArray(int n) {
	      int a[] = new int[n];
	      for (int i = 0; i < n; i++) {
	        a[i] = nextInt();
	      }
	      return a;
	    }
 
	    public String readString() {
	      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 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 boolean isSpaceChar(int c) {
	      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }
 
	    private boolean isEndOfLine(int c) {
	      return c == '\n' || c == '\r' || c == -1;
	    }
	}
    public static void main(String[] args) throws IOException 
    {
        InputReader in=new InputReader(System.in);
        int n=in.nextInt();
        int m=in.nextInt();
        int cs=in.nextInt();
        int ce=in.nextInt();
        int v=in.nextInt();
        int[] st=new int[cs];
        int[] li=new int[ce];
        st=in.nextIntArray(cs);
        li=in.nextIntArray(ce);
        int q=in.nextInt();
        for(int a=0;a<q;a++)
        {
            int x1=in.nextInt();
            int y1=in.nextInt();
            int x2=in.nextInt();
            int y2=in.nextInt();
            if(x1==x2)
            {
                System.out.println((int)Math.abs(y2-y1));
            }
            else
            {
                int ts=0,te=0;
                int si=Arrays.binarySearch(st,y1);
                int ei=Arrays.binarySearch(li,y1);
                //System.out.println(si);
                //System.out.println(ei);
                if(cs>0)
                {
                if(si>=0)
                {
                    int cost=0;
                    ts+=(int)Math.abs(x2-x1);
                    ts+=(int)Math.abs(y2-y1);
                }
                else
                {
                    si=(-1)*(si+1);
                    if(si==0)
                    {
                        ts+=(int)Math.abs(y1-st[si]);
                        ts+=(int)Math.abs(x2-x1);
                        ts+=(int)Math.abs(y2-st[si]);
                    }
                    else if(si==cs)
                    {
                        ts+=(int)Math.abs(y1-st[si-1]);
                        ts+=(int)Math.abs(x2-x1);
                        ts+=(int)Math.abs(y2-st[si-1]);
                    }
                    else
                    {
                        int c1=(int)Math.abs(y1-st[si]);
                        int c2=(int)Math.abs(y1-st[si-1]);
                        ts+=(int)Math.min(c1,c2);
                        ts+=(int)Math.abs(x2-x1);
                        if(c1<=c2)
                        {
                            ts+=(int)Math.abs(st[si]-y2);
                        }
                        else
                        {
                            ts+=(int)Math.abs(st[si-1]-y2);
                        }
                    }
                }
                }
                else
                    ts=Integer.MAX_VALUE;
                if(ce>0)
                {
                if(ei>=0)
                {
                    int cost=0;
                    if(((int)Math.abs(x2-x1))%v!=0)
                        te+=(((int)Math.abs(x2-x1))/v)+1;
                    else
                        te+=((int)Math.abs(x2-x1))/v;
                    te+=(int)Math.abs(y2-y1);
                }
                else
                {
                    ei=(-1)*(ei+1);
                    if(ei==0)
                    {
                        te+=(int)Math.abs(y1-li[ei]);
                        if(((int)Math.abs(x2-x1))%v!=0)
                            te+=(((int)Math.abs(x2-x1))/v)+1;
                        else
                            te+=((int)Math.abs(x2-x1))/v;
                        te+=(int)Math.abs(y2-li[ei]);
                    }
                    else if(ei==ce)
                    {
                        te+=(int)Math.abs(y1-li[ei-1]);
                        if(((int)Math.abs(x2-x1))%v!=0)
                            te+=(((int)Math.abs(x2-x1))/v)+1;
                        else
                            te+=((int)Math.abs(x2-x1))/v;
                        te+=(int)Math.abs(y2-li[ei-1]);
                    }
                    else
                    {
                        int c1=(int)Math.abs(y1-li[ei]);
                        int c2=(int)Math.abs(y1-li[ei-1]);
                        te+=(int)Math.min(c1,c2);
                        if(((int)Math.abs(x2-x1))%v!=0)
                            te+=(((int)Math.abs(x2-x1))/v)+1;
                        else
                            te+=((int)Math.abs(x2-x1))/v;
                        if(c1<=c2)
                        {
                            te+=(int)Math.abs(li[ei]-y2);
                        }
                        else
                        {
                            te+=(int)Math.abs(li[ei-1]-y2);
                        }
                    }
                }
                }
                else
                    te=Integer.MAX_VALUE;
                //System.out.println(ts+" "+te);
                System.out.println((int)Math.min(ts,te));
            }
        }
    }
}