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 Codeforces
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s[]=bu.readLine().split(" ");
        int n=Integer.parseInt(s[0]),m=Integer.parseInt(s[1]),cl=Integer.parseInt(s[2]),ce=Integer.parseInt(s[3]),v=Integer.parseInt(s[4]);
        int i;
        st=new int[cl]; e=new int[ce];
        s=bu.readLine().split(" ");
        for(i=0;i<cl;i++)
        st[i]=Integer.parseInt(s[i]);
        s=bu.readLine().split(" ");
        for(i=0;i<ce;i++)
        e[i]=Integer.parseInt(s[i]);

        int q=Integer.parseInt(bu.readLine());
        while(q-->0)
        {
            s=bu.readLine().split(" ");
            int x1=Integer.parseInt(s[0]),y1=Integer.parseInt(s[1]),x2=Integer.parseInt(s[2]),y2=Integer.parseInt(s[3]);
            int d=calc(x1,y1,x2,y2,v);
            d=Math.min(d,calc(x2,y2,x1,y1,v));
            sb.append(d+"\n");
        }
        System.out.print(sb);
    }
    static int st[],e[];

    static int calc(int x1,int y1,int x2,int y2,int v)
    {
        int p=next(st,y1),d=Integer.MAX_VALUE,cur;  //stair to right of y1
        if(p!=M)
        {
            cur=Math.abs(x1-x2)+p-y1+Math.abs(p-y2);
            d=Math.min(cur,d);
        }
        p=next(e,y1);
        if(p!=M)    //elevator to right of y1
        {
            cur=Math.abs(x1-x2);
            cur=cur/v+(cur%v==0?0:1);
            cur+=p-y1+Math.abs(p-y2);
            d=Math.min(cur,d);
        }
        p=before(st,y1);    //stair to the left of y1
        if(p!=M)
        {
            cur=Math.abs(x1-x2)+y1-p+Math.abs(p-y2);
            d=Math.min(d,cur);
        }
        p=before(e,y1);     //elevator to left of y1
        if(p!=M)
        {
            cur=Math.abs(x1-x2);
            cur=cur/v+(cur%v==0?0:1);
            cur+=y1-p+Math.abs(p-y2);
            d=Math.min(d,cur);
        }
        if(x1==x2) d=Math.min(d,Math.abs(y1-y2));   //same floor nothing needed
        return d;
    }

    static int M=(int)1e8*5;
    static int next(int a[],int n)
    {
        if(a.length==0 || a[a.length-1]<n) return M;
        int l=0,r=a.length-1,mid,ans=r;
        while(l<=r)
        {
            mid=(l+r)>>1;
            if(a[mid]>n)
            {
                ans=mid;
                r=mid-1;
            }
            else l=mid+1;
        }
        return a[ans];
    }

    static int before(int a[],int n)
    {
        if(a.length==0 || a[0]>n) return M;
        int l=0,r=a.length-1,mid,ans=0;
        while(l<=r)
        {
            mid=(l+r)>>1;
            if(a[mid]>n) r=mid-1;
            else
            {
                ans=mid;
                l=mid+1;
            }
        }
        return a[ans];
    }
}
