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.Scanner;

public class ProblemA {

    private static long column1;
    private static long column2;

    private static long getClosestStairs(long var1,long var2,long target){
        if(target-var1>=var2-target){
            column1=var2;
            return var2;
        }
        else{
            column1=var1;
            return var1;
        }

    }

    private static long getClosestElevators(long var1,long var2,long target){
        if(target-var1>=var2-target){
            column2=var2;
            return var2;
        }
        else{
            column2=var1;
            return var1;
        }

    }
    private static long distanceColumnStairs(long []array,long sm){
        int begin=0;
        int end=array.length;
        int mid=0;
        if(sm<array[0]){
            column1=array[0];
            return Math.abs(sm-array[0]);
        }
        else if(sm>array[end-1]){
            column1=array[end-1];
            return Math.abs((sm-array[0]));
        }
        while(begin<end){
            mid=(begin+end)/2;
            if(sm<array[mid]){
                if(mid>0 && sm>array[mid-1])
                    return Math.abs(sm-getClosestStairs(array[mid-1],array[mid],sm));
                end=mid;
            }
            else{
                if(mid<array.length-1 && sm<array[mid+1])
                    return Math.abs(sm-getClosestStairs(array[mid],array[mid+1],sm));
                begin=mid+1;
            }
        }
        column1=array[mid];
        return Math.abs(sm-array[mid]);
    }
    private static long distanceColumnElevators(long []array,long sm){
        int begin=0;
        int end=array.length;
        int mid=0;
        if(sm<array[0]){
            column2=array[0];
            return Math.abs(sm-array[0]);
        }
        else if(sm>array[end-1]){
            column2=array[end-1];
            return Math.abs((sm-array[0]));
        }

        while(begin<end){
            mid=(begin+end)/2;
            if(sm<array[mid]){
                if(mid>0 && sm>array[mid-1])
                    return Math.abs(sm-getClosestElevators(array[mid-1],array[mid],sm));
                end=mid;
            }
            else{
                if(mid<array.length-1 && sm<array[mid+1])
                    return Math.abs(sm-getClosestElevators(array[mid],array[mid+1],sm));
                begin=mid+1;
            }
        }
        column2=array[mid];
        return Math.abs(sm-array[mid]);
    }


    private static long getElevators(long []elevators,long sn,long sm,long dn,long dm,long speed){
        long total=0;
        total=total+distanceColumnElevators(elevators,sm);
//        System.out.println("Dis: "+total);
        long temp=Math.abs(dn-sn);
//        System.out.println("Temp: "+temp);
        if(speed!=1){
            if(temp%speed!=0)
                total=total+temp/speed+1;
            else
                total=total+temp/speed;
        }
        else
            total=total+temp;
//        System.out.println("total: "+total);
//        System.out.println("Column2: "+column2);
        if(dm==column2)
            return total;
        else
            return total+Math.abs(dm-column2);
    }
    private static long getStairs(long []stairs,long sn,long sm,long dn,long dm){
        long total=0;
        total=total+distanceColumnStairs(stairs,sm);
        total=total+Math.abs(sn-dn);
        if(dm==column1)
            return total;
        else
            return total+Math.abs(column1-dm);

    }
    public static void main(String[] args) throws Exception{
        Scanner in=new Scanner(System.in);
        in.nextInt();
        in.nextInt();
        int numberOfStairs=in.nextInt();
        int numberOfElevators=in.nextInt();
        int speed=in.nextInt();
        long []stairs=new long[numberOfStairs];
        for(int i=0;i<stairs.length;i++)
            stairs[i]=in.nextLong();
        long []elevators=new long[numberOfElevators];
        for(int i=0;i<elevators.length;i++)
            elevators[i]=in.nextLong();
        int query=in.nextInt();
        for(int i=0;i<query;i++){
            long sn=in.nextLong();
            long sm=in.nextLong();
            long dn=in.nextLong();
            long dm=in.nextLong();
            long stairTime=Integer.MAX_VALUE;
            if(numberOfStairs!=0)
                stairTime=getStairs(stairs,sn,sm,dn,dm);
            long elevatorTime=Integer.MAX_VALUE;
            if(numberOfElevators!=0)
                elevatorTime=getElevators(elevators,sn,sm,dn,dm,speed);
            if(stairTime<elevatorTime)
                System.out.println(stairTime);
            else
                System.out.println(elevatorTime);
        }
    }
}
