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 distanceColumn(long []stairs,long sm){
        long diff=Integer.MAX_VALUE;
        for(int i=0;i<stairs.length;i++){
            long temp=Math.abs(sm-stairs[i]);
            if(temp<diff){
                diff=temp;
                column1=stairs[i];
            }
            else
                break;
        }
        return diff;
    }

    private static long distanceColumnElevator(long []elevators,long sm){
        long diff=Integer.MAX_VALUE;
        for(int i=0;i<elevators.length;i++){
            long temp=Math.abs(sm-elevators[i]);
            if(temp<diff){
                diff=temp;
                column2=elevators[i];
            }
            else
                break;
        }
        return diff;
    }

    private static long getElevators(long []elevators,long sn,long sm,long dn,long dm,long speed){
        long total=0;
        total=total+distanceColumnElevator(elevators,sm);
        long temp=Math.abs(dn-sn);
        if(speed!=1)
            total=total+temp/(speed-1);
        else
            total=total+temp;
        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+distanceColumn(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=getStairs(stairs,sn,sm,dn,dm);
            long elevatorTime=getElevators(elevators,sn,sm,dn,dm,speed);
            if(stairTime<elevatorTime)
                System.out.println(stairTime);
            else
                System.out.println(elevatorTime);
        }
    }
}
