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.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class c{

    static int m;

    static int bin(int[] arr, int x){
        int left=-1,right = arr.length;
        while(right-left>1){
            int center = (left+right)/2;
            if(arr[center]<x)left=center;
            else right=center;
        }
        return right;
    }

    static int nearest(int x1,int x2, int[] arr){
        //index
        int x1r = bin(arr, x1);
        int x2r = bin(arr, x2);
        if(x1r<=x2r-1)return 0;
        int res = Integer.MAX_VALUE;
        if(x1r-1 >=0)res = Math.min(res, x1-arr[x1r-1]);
        if(x2r<arr.length)res=Math.min(res, arr[x2r]-x2);
        return res;
    }

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        m = scan.nextInt();
        int cs = scan.nextInt();
        int ce = scan.nextInt();
        int v = scan.nextInt();
        int[] stair = new int[cs];
        int[] elev = new int[ce];
        for(int i=0;i<cs;++i)stair[i]=Integer.parseInt(scan.next());
        for(int i=0;i<ce;++i)elev[i]=Integer.parseInt(scan.next());
        int q = scan.nextInt();
        PrintWriter out = new PrintWriter(System.out);
        while(q-->0){
            int y1 = Integer.parseInt(scan.next());
            int x1 = Integer.parseInt(scan.next());
            int y2 = Integer.parseInt((scan.next()));
            int x2 = Integer.parseInt(scan.next());
            int y = Math.abs(y1-y2);
            if(x1>x2){
                int tmp = x1;
                x1 = x2;x2=tmp;
            }
            out.println(Math.min(x2-x1+y + 2*nearest(x1,x2,stair), (x2-x1+((y-1)/v)+1 + 2*nearest(x1, x2, elev))));
        }
        out.flush();
        out.close();
    }
}