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

#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define bit(x,j) ((x>>j)&1)
using namespace std;
// bitset<8>set1(p);
// __builtin_popcountll(x);
// bitset<100> b("1010");
ll int mod=998244353;
int mul(ll int x, ll int y)
{
    return (x * 1ll * y) % mod;
}

ll int add(ll int x,ll int y)
{
    x += y;
    while(x >= mod) x -= mod;
    while(x < 0) x += mod;
    return x;
}

long long power(long long a, long long b,ll m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = mul(res,a);
        a = mul(a,a);
        b >>= 1;
    }
    return res%m;
    }


  ll int binomial(ll int n, ll int k) 
{ 
    ll int C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll int i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (int j = min(i, k); j > 0; j--) 
            C[j] = C[j]+C[j-1]; 
    } 
    return C[k]; 
} 
  vector<int> pr;
  bool prime[10000000];
void Sieve(ll int n) 
{ 
    memset(prime, true, sizeof(prime)); 
    prime[1]=false;
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            pr.push_back(p);
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
}
 


//It reurns Fn,Fn+1
pair<int, int> fib (int n) {
    if (n == 0)
        return {0, 1};

    auto p = fib(n >> 1);
    int c = p.first * (2 * p.second - p.first);
    int d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}
int sum(int n)  
{  
    if (n == 0)  
    return 0;  
    return (n % 10 + sum(n / 10));  
}  
ll int factori(ll int n,ll int m) 
{ 
    ll int fact = 1; 
    for(int i=2;i<=n;i++) { 
        fact = (fact * i)%m; 
    } 
    return fact%m; 
} 

int reduce(int x, int y) 
{ 
    int d; 
    d = __gcd(x, y); 
  
    x = x / d; 
    y = y / d; 
    return x; 
} 

int binarySearch(int arr[], int l, int r, int x) 
{ 
    if (r >= l) { 
        int mid = l + (r - l) / 2; 
  
        if (arr[mid] == x) 
            return mid; 
  
        if (arr[mid] > x) 
            return binarySearch(arr, l, mid - 1, x); 
  
        // Else the element can only be present 
        // in right subarray 
        return binarySearch(arr, mid + 1, r, x); 
    } 
  
    // We reach here when element is not 
    // present in array 
    return -1; 
} 

long long gcd(long long int a, long long int b)
{
  if (b == 0)
    return a;
  return gcd(b, a % b);
}
 
// Function to return LCM of two numbers 
long long lcm(int a, int b)
{
    return (a / gcd(a, b)) * b;
}

ll int money_left(ll int money_left,long long int a[],ll int n)
{
    ll int l = 0, r = n;
    while (l < r)
    {
        ll int m = (l + r + 1) / 2;
        if (a[m] <= money_left) l = m; else r = m-1;
    }
    return l;
}




 int main() {
    ios;
    ll int n,m,cl,ce,v;
    cin>>n>>m>>cl>>ce>>v;
    ll int a[cl],b[ce];
    for(int i=0;i<cl;i++)
    cin>>a[i];
    for(int i=0;i<ce;i++)
    cin>>b[i];
    sort(a,a+cl);
    sort(b,b+ce);
    int q;
    cin>>q;
    while(q--)
    {
        ll int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        ll int m=1e18;
        if(x1==x2)
        {
            cout<<abs(x1-x2)<<endl;
        }
        else
        {
        if(ce>0)
        {
            ll int p=lower_bound(b,b+ce,y1)-b;
        if(p<ce)
        {
            ll int l=(abs(x2-x1)+v-1)/v;
            l+=abs(b[p]-y2)+abs(y1-b[p]);
            m=min(m,l);
        }
        }
         if(cl>0)
         {
            ll int p=lower_bound(a,a+cl,y1)-a;
         if(p<cl)
        {
            ll int l=abs(x2-x1);
            l+=abs(a[p]-y2)+abs(y1-a[p]);
            m=min(m,l);
        }
         }
        if(ce>0)
        {
          ll int p=money_left(y1,b,ce);
        if(p<ce)
        {
            ll int l=(abs(x2-x1)+v-1)/v;
             l+=abs(b[p]-y2)+abs(y1-b[p]);
            m=min(m,l);
            //cout<<l<<" ";
        }
        }
        if(cl>0)
        {
           ll int p=money_left(y1,a,cl);
        if(p<cl)
        {
            ll int l=abs(x2-x1);
            l+=abs(a[p]-y2)+abs(y1-a[p]);
            m=min(m,l);
            //cout<<l<<" ";
        }
        }
        cout<<m<<endl;
        }
    }
}
