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.*;
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer stk = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(stk.nextToken());
        int m = Integer.parseInt(stk.nextToken());
        int cl = Integer.parseInt(stk.nextToken());
        int ce = Integer.parseInt(stk.nextToken());
        long v = Long.parseLong(stk.nextToken());
        TreeSet<Long> stairs = null;
        TreeSet<Long> ele = null;
        if(cl>=1){
            stairs = new TreeSet<>();
            stk = new StringTokenizer(br.readLine());
            for(int i=0;i<cl;i++){
                stairs.add(Long.parseLong(stk.nextToken()));
            }
        }
        else{
            br.readLine();
        }
        if(ce>=1){
            ele= new TreeSet<>();
            stk = new StringTokenizer(br.readLine());
            for(int i=0;i<ce; i++ )
                ele.add(Long.parseLong(stk.nextToken()));
        }
        else
            br.readLine();
        int q=  Integer.parseInt(br.readLine());
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<q;i++){
            stk = new StringTokenizer(br.readLine());
            int x1 = Integer.parseInt(stk.nextToken());
            int y1 = Integer.parseInt(stk.nextToken());
            int x2 = Integer.parseInt(stk.nextToken());
            int y2 = Integer.parseInt(stk.nextToken());
            long min = 0;
            if(stairs==null){
                min = getEle(ele,y1,x1,y2,x2,v);
            }
            else if(ele==null){
                min = getStair(stairs,y1,x1,y2,x2);
            }
            else{
                // System.out.println(getStair(stairs,y1,x1,y2,x2)+" ");
                min = Math.min(getStair(stairs,y1,x1,y2,x2),getEle(ele,y1,x1,y2,x2,v));
            }
            sb.append(min).append('\n');
        }
        System.out.print(sb);
    }
    public static long getStair(TreeSet<Long> stair,long x1,long y1,long x2,long y2){
        Long lower1 = stair.lower(x1);
        Long lower2 = stair.lower(x2);
        Long higher1 = stair.higher(x1);
        Long higher2 = stair.higher(x2);
        long min = 200000000000l;
        if(lower1!=null) min = Math.min(min,getDist(x1,x2,lower1));
        if(lower2!=null) min = Math.min(min,getDist(x1,x2,lower2));
        if(higher1!=null) min = Math.min(min,getDist(x1,x2,higher1));
        if(higher2!=null) min = Math.min(min,getDist(x1,x2,higher2));
        return min+Math.abs(y1-y2);
    }
    public static long getDist(long departX,long distX,long dvX){
        return Math.abs(departX-dvX) + Math.abs(distX-dvX);
    }
    public static long getEle(TreeSet<Long> ele,long x1,long y1,long x2,long y2,long v){
        Long lower1 = ele.lower(x1);
        Long lower2 = ele.lower(x2);
        Long higher1 = ele.higher(x1);
        Long higher2 = ele.higher(x2);
        long min = 200000000000l;
        if(lower1!=null) min = Math.min(min,getDist(x1,x2,lower1));
        if(lower2!=null) min = Math.min(min,getDist(x1,x2,lower2));
        if(higher1!=null) min = Math.min(min,getDist(x1,x2,higher1));
        if(higher2!=null) min = Math.min(min,getDist(x1,x2,higher2));
        long differ = Math.abs(y1-y2);
        if(differ%v==0){
            return min + differ/v;
        }
        else{
            return min + (differ/v)+1;
        }
    }
}