In the year of $30XX$ participants of some world programming championship live in a single large hotel. The hotel has $n$ floors. Each floor has $m$ sections with a single corridor connecting all of them. The sections are enumerated from $1$ to $m$ along the corridor, and all sections with equal numbers on different floors are located exactly one above the other. Thus, the hotel can be represented as a rectangle of height $n$ and width $m$. We can denote sections with pairs of integers $(i, j)$, where $i$ is the floor, and $j$ is the section number on the floor.

The guests can walk along the corridor on each floor, use stairs and elevators. Each stairs or elevator occupies all sections $(1, x)$, $(2, x)$, $\ldots$, $(n, x)$ for some $x$ between $1$ and $m$. All sections not occupied with stairs or elevators contain guest rooms. It takes one time unit to move between neighboring sections on the same floor or to move one floor up or down using stairs. It takes one time unit to move up to $v$ floors in any direction using an elevator. You can assume you don't have to wait for an elevator, and the time needed to enter or exit an elevator is negligible.

You are to process $q$ queries. Each query is a question "what is the minimum time needed to go from a room in section $(x_1, y_1)$ to a room in section $(x_2, y_2)$?"
The first line contains five integers $n, m, c_l, c_e, v$ ($2 \leq n, m \leq 10^8$, $0 \leq c_l, c_e \leq 10^5$, $1 \leq c_l + c_e \leq m - 1$, $1 \leq v \leq n - 1$) — the number of floors and section on each floor, the number of stairs, the number of elevators and the maximum speed of an elevator, respectively.

The second line contains $c_l$ integers $l_1, \ldots, l_{c_l}$ in increasing order ($1 \leq l_i \leq m$), denoting the positions of the stairs. If $c_l = 0$, the second line is empty.

The third line contains $c_e$ integers $e_1, \ldots, e_{c_e}$ in increasing order, denoting the elevators positions in the same format. It is guaranteed that all integers $l_i$ and $e_i$ are distinct.

The fourth line contains a single integer $q$ ($1 \leq q \leq 10^5$) — the number of queries.

The next $q$ lines describe queries. Each of these lines contains four integers $x_1, y_1, x_2, y_2$ ($1 \leq x_1, x_2 \leq n$, $1 \leq y_1, y_2 \leq m$) — the coordinates of starting and finishing sections for the query. It is guaranteed that the starting and finishing sections are distinct. It is also guaranteed that these sections contain guest rooms, i. e. $y_1$ and $y_2$ are not among $l_i$ and $e_i$.
In the first query the optimal way is to go to the elevator in the 5-th section in four time units, use it to go to the fifth floor in two time units and go to the destination in one more time unit.

In the second query it is still optimal to use the elevator, but in the third query it is better to use the stairs in the section 2.
5 6 1 1 3
2
5
3
1 1 5 6
1 3 5 4
3 3 5 3
7
5
4
2 2 0 1 1

1
1
1 2 2 2
3
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
6
4
3
5
4
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
3
4
4
3
3
4
3
3
4
3
2 5 1 0 1
2

1
1 4 1 5
1
2 10 1 1 1
1
10
1
1 5 1 8
3
4 4 1 0 1
1

1
1 2 1 4
2
2 4 1 1 1
1
2
1
2 3 2 4
1
1000 1000 1 1 10
1
2
1
1 900 1 1000
100
2 4 1 1 1
1
4
1
1 2 1 3
1
5 5 1 1 1
3
2
1
1 5 1 1
4
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define iiordered_set tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;

//Bit Functions
#define gcd __gcd
#define lsb __builtin_ffs
#define ldz __builtin_clz
#define tlz __builtin_ctz
#define stc __builtin_popcount
#define prtb(n) cout << bitset<20>(n) << "\n";

//Debugging
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define what_is(x) cerr << #x << " is " << x << endl;
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

//STL Declarations
#define vi vector<int> 
#define vvi vector<vi>
#define vl vector<long long>
#define vvl vector<vl>
#define vb vector<bool> 
#define pii pair<int,int> 
#define fr first
#define sc second
#define u_s unordered_set
#define ump unordered_map 
#define ins insert
#define p_q(x) priority_queue<x>

//STL Functions
#define mt make_tuple
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define muq make_unique
#define all(x) x.begin(),x.end()
#define rot(vec,k) rotate(vec.begin(), vec.begin() + k, vec.end());
#define bs(vec,key) binary_search(all(vec), key)
#define parti(vec,p) partition_point(all(vec), p) - vec.begin()
#define srt(cnt) sort(all(cnt))
#define lb(cnt,x) lower_bound(all(cnt),x)
#define ub(cnt,x) upper_bound(all(cnt),x)
#define mxm(cnt) *max_element(all(cnt))
#define mnm(cnt) *min_element(all(cnt))
#define mxmptr(cnt) max_element(all(cnt))
#define mnmptr(cnt) min_element(all(cnt))
#define rev(cnt) reverse(all(cnt))
#define accum(cnt) accumulate(all(cnt),0)
#define look(cnt) for(auto c:cnt) cout<<c<<" "; cout<<"\n";
#define pre(x,cont) find(all(cont),x)!=cont.end()
#define pb push_back

//Input Functions
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << t<<" "; return os << endl; }
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << v.first << " " << v.second ; }

typedef long long int ll;
ll mod = 10000000007;

//Generalised Sum Function
int sum() { return 0; }
template<typename T, typename... Args>
T sum(T a, Args... args) { return a + sum(args...); }

vector<int> seive(int N){
    vector<bool> visited(N+1,false);
    vi pr;
    for(int i=2;i<=N;i++){
        if(!visited[i]){
            int j = i;
            while(j<=N){pr.pb(j);visited[j] = true;j+=i;}}}
    return pr;
}
ll ceil(ll a,ll b){
	if(b<0)a=-a,b=-b;
	if(a>=0)return (a+b-1)/b;
	return a/b;
}
long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}
ll inverse(ll a,ll m=mod)
{
    return bpow(a,m-2,m);
}
vvl matmul(const vvl &a,const vvl &b,ll M=mod)
{
    int n=a.size(),m=a[0].size(),l=b[0].size();
    assert(m==b.size());
    vvl c(n,vl(l,0));
    rep(i,0,n)
    rep(j,0,l)
    rep(k,0,m)
    {
        c[i][j]=(c[i][j]+a[i][k]*b[k][j])%M;
    }
    return c;
}
vvl matpow(vvl a,ll p,ll M=mod)
{
    assert(a.size()==a[0].size());
    int n=a.size();
    vvl res(n,vl(n,0));
    rep(i,0,n)   res[i][i]=1;
    while(p>0)
    {
        if(p&1) res=matmul(res,a,M);
        a=matmul(a,a,M);
        p>>=1;
    }
    return res;
}
int n,m,l,e,v;
int main(){ _ 
    cin>>n>>m>>l>>e>>v;
    vi S(l);cin>>S;
    vi E(e);cin>>E;
    int q;cin>>q;
    while(q--){
        int ans = INT_MAX;
        int x1,x2,y1,y2;cin>>x1>>y1>>x2>>y2;
        auto it1 = lb(S,y1);
        auto it3 = lb(E,y1);
        if(it1!=S.end()){
            int vv = *it1;
            int cand = abs(y1-vv) + abs(y2-vv) + abs(x1-x2);
            ans = min(ans,cand);
        }
        if(!S.empty() && it1!=S.begin()){
            auto it2 = it1-1;
            int vv = *it2;
            int cand = abs(y1-vv) + abs(y2-vv) + abs(x1-x2);
            ans = min(ans,cand);
        }
        if(it3!=E.end()){
            int vv = *it3;
            int cand = abs(y1-vv) + abs(y2-vv) + ceil(abs(x1-x2),v);
            ans = min(ans,cand);
        }
        if(!E.empty() && it3!=E.begin()){
            auto it4 = it3 - 1;
            int vv = *it4;
            int cand = abs(y1-vv) + abs(y2-vv) + ceil(abs(x1-x2),v);
            ans = min(ans,cand);
        }
        cout << ans << "\n";
    }
    return 0;
}