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

public final class ele
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static Random rnd=new Random();
	static TreeSet<Integer> t1,t2;
	
	static int get(int dis,int v)
	{
		return (dis/v)+(dis%v==0?0:1);
	}
	
	static int solve(int x1,int y1,int x2,int y2,int v)
	{
		if(x1==x2)
		{
			return Math.abs(y1-y2);
		}
		
		int min=Integer.MAX_VALUE;
		
		Integer left=t1.floor(y1),right=t1.ceiling(y1);

		if(left!=null)
		{
			min=Math.min(min,y1-left+Math.abs(y2-left)+x2-x1);
		}
		
		if(right!=null)
		{
			min=Math.min(min,right-y1+Math.abs(y2-right)+x2-x1);
		}
		
		left=t2.floor(y1);right=t2.ceiling(y1);

		if(left!=null)
		{
			min=Math.min(min,y1-left+Math.abs(y2-left)+get(x2-x1,v));
		}
		
		if(right!=null)
		{
			min=Math.min(min,right-y1+Math.abs(y2-right)+get(x2-x1,v));
		}
		
		return min;
	}
	
    public static void main(String args[]) throws Exception
    {	
		int n=sc.nextInt(),m=sc.nextInt(),val1=sc.nextInt(),val2=sc.nextInt(),v=sc.nextInt();
		
		t1=new TreeSet<>();t2=new TreeSet<>();
		
		for(int i=0;i<val1;i++)
		{
			t1.add(sc.nextInt());
		}
		
		for(int i=0;i<val2;i++)
		{
			t2.add(sc.nextInt());
		}
		
		int q=sc.nextInt();
		
		for(int i=0;i<q;i++)
		{
			int x1=sc.nextInt(),y1=sc.nextInt(),x2=sc.nextInt(),y2=sc.nextInt();
			
			if(x1>x2)
			{
				int temp=x1;x1=x2;x2=temp;
				
				temp=y1;y1=y2;y2=temp;
				
				// now , x1<=x2...
			}
			
			out.println(solve(x1,y1,x2,y2,v));
		}
		
		out.close();
    }
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}