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.IOException;
import java.util.*;
public class d {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        //     BufferedReader s=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        StringBuilder sb1=new StringBuilder();
        int n=s.nextInt();
        int m=s.nextInt();
        int cl=s.nextInt();
        int ce=s.nextInt();
        int v=s.nextInt();
        long[] l=new long[cl];
        long[] e=new long[ce];

        for(int i=0;i<cl;i++)
            l[i]=s.nextInt();
        for(int i=0;i<ce;i++)
            e[i]=s.nextInt();
        int q=s.nextInt();
        while(q-->0){
            int x1=s.nextInt();
            int y1=s.nextInt();
            int x2=s.nextInt();
            int y2=s.nextInt();
            int low=0;int high=cl-1;
            if(x1==x2){
                System.out.println(Math.abs(y2-y1));
                System.exit(0);
            }
            long ans=Integer.MAX_VALUE;
            while(low<=high){
                int mid=(low+high)/2;
                if(l[mid]<=y1){
                    ans=l[mid];
                    low=mid+1;
                }else{
                    high=mid-1;
                }
            }
            //          System.out.println(ans);
            long fans=Integer.MAX_VALUE;
            if(ans!=Integer.MAX_VALUE){
                //       System.out.println(y1+" "+ans+" "+x2+" "+fans);
                fans=y1-ans;
                fans+=Math.abs(x2-x1);
                fans+=Math.abs(y2-ans);}
            low=0; high=cl-1;
            ans=Integer.MAX_VALUE;
            while(low<=high){
                int mid=(low+high)/2;
                if(l[mid]>=y1){
                    ans=l[mid];
                    high=mid-1;
                }else{
                    low=mid+1;
                }
            }
            long x=ans-y1;
            x+=Math.abs(x2-x1);
            x+=Math.abs(y2-ans);
            if(ans!=Integer.MAX_VALUE)
                fans=Math.min(fans,x);




            low=0; high=ce-1;
            ans=Integer.MAX_VALUE;
            while(low<=high){
                int mid=(low+high)/2;
                if(e[mid]<=y1){
                    ans=e[mid];
                    low=mid+1;
                }else{
                    high=mid-1;
                }
            }
            long fans1=Integer.MAX_VALUE;
            if(ans!=Integer.MAX_VALUE){
                fans1=y1-ans;
                fans1+=Math.abs(x2-x1)/v;
                if(Math.abs(x2-x1)%v!=0) fans1+=1;
                fans1+=Math.abs(y2-ans);}
            fans=Math.min(fans,fans1);
            low=0;ans=Integer.MAX_VALUE;
            high=ce-1;
            while(low<=high){
                int mid=(low+high)/2;
                if(e[mid]>=y1){
                    ans=e[mid];
                    high=mid-1;
                }else{
                    low=mid+1;
                }
            }

            x=ans-y1;

            x+=Math.abs(x2-x1)/v;
            if(Math.abs(x2-x1)%v!=0) x+=1;   x+=Math.abs(y2-ans);
            fans=Math.min(fans,x);
            System.out.println(fans);





        }
    }
    static  void computeLPSArray(String pat, int M, int lps[]) {
        int len = 0;
        int i = 1;
        lps[0] = 0;
        while (i < M) {
            if (pat.charAt(i) == pat.charAt(len)) {
                len++;
                lps[i] = len;
                i++;
            }
            else
            {
                if (len != 0) {
                    len = lps[len - 1];
                }
                else
                {
                    lps[i] = len;
                    i++;
                }
            }
        }
    }
    static boolean isPrime(int n) {
        if (n <= 1) return false;
        if (n <= 3) return true;

        if (n % 2 == 0 || n % 3 == 0) return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }
    static long powerwithmod(long  x, long y, int p) {
        long  res = 1;
        x = x % p;
        while (y > 0) {
            if ((y & 1) == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }
    static long  powerwithoutmod(long x, int y) {
        long  temp;
        if( y == 0)
            return 1;
        temp = powerwithoutmod(x, y/2);
        if (y%2 == 0)
            return temp*temp;
        else
        {
            if(y > 0)
                return x * temp * temp;
            else
                return (temp * temp) / x;
        }
    }
    static void fracion(double x) {
        String a = "" + x;
        String spilts[] = a.split("\\."); // split using decimal
        int b = spilts[1].length(); // find the decimal length
        int denominator = (int) Math.pow(10, b); // calculate the denominator
        int numerator = (int) (x * denominator); // calculate the nerumrator Ex
        // 1.2*10 = 12
        int gcd = (int) gcd((long) numerator, denominator); // Find the greatest common
        // divisor bw them
        String fraction = "" + numerator / gcd + "/" + denominator / gcd;
        // System.out.println((denominator/gcd));
        long x1 = modInverse(denominator / gcd, 998244353);
        //  System.out.println(x1);
        System.out.println((((numerator / gcd) % 998244353 * (x1 % 998244353)) % 998244353));
    }
    static int bfs(int i1, ArrayList<Integer>[] h, int[] vis, int n,int val1) {
        Queue<Integer> q = new LinkedList<Integer>();
        q.add(i1);Queue<Integer> aq=new LinkedList<Integer>();
        aq.add(0);
        while(!q.isEmpty()){
            int i=q.poll();
            int val=aq.poll();
            if(i==n){
                return val;
            }
            if(h[i]!=null){
                for(Integer j:h[i]){
                    if(vis[j]==0){
                        q.add(j);vis[j]=1;
                        aq.add(val+1);}
                }
            }
        }return -1;
    }
    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    static long modInverse(long a, int m)
    {
        return (powerwithmod(a, m - 2, m));
    }
    static int MAXN=100001;
    static int[] spf=new int[MAXN];
    static void sieve() {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)
            spf[i] = i;
        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;
        for (int i=3; i*i<MAXN; i++)
        {
            if (spf[i] == i)
            {
                for (int j=i*i; j<MAXN; j+=i)

                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }
    static Vector<Integer> getFactorizationUsingSeive(int x) {
        Vector<Integer> ret = new Vector<Integer>();
        while (x != 1)
        {
            ret.add(spf[x]);
            x = x / spf[x];
        }
        return ret;
    }
   /* static long[] fac = new long[MAXN+1];
     static void calculatefac(int mod){
        for (int i = 1 ;i <= MAXN; i++)
            fac[i] = fac[i-1] * i % mod;
     }
      static long nCrModPFermat(int n, int r, int mod) {
         if (r == 0)
            return 1;
        fac[0] = 1;
        return (fac[n]* modInverse(fac[r], mod)
                % mod * modInverse(fac[n-r], mod)
                                    % mod) % mod;
    } */}
class Student {
    int l;int r;
    public Student(int l, int r) {
        this.l = l;
        this.r = r;
    }

    public String toString()
    {
        return this.l+" ";
    }
}
class Sortbyroll implements Comparator<Student> {

    public int compare(Student a, Student b){
        if(a.l==b.l) return a.r-b.r;
        return b.l-a.l;  }
}
class Sortbyroll1 implements Comparator<Student> {
    public int compare(Student a, Student b){
        if(a.r==b.r) return a.l-b.l;
        return b.l-a.l;
    }
}