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>
using namespace std;
const long long OO = (long long)1e18;
const long long mod = (1e9) + 7;
const double PI = acos(-1.0);
const double EPS = 1e-8;
int dx[]{-1, -1, -1, 0, 0, 1, 1, 1};
int dy[]{-1, 0, 1, -1, 1, -1, 0, 1};
void file() {}
long long low(long long x, vector<long long>& v) {
  long long lo = 0, hi = ((int)(v).size()) - 1, ans = 1e12;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (v[mid] <= x) {
      ans = mid;
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  if (ans == 1e12)
    return ans;
  else
    return v[ans];
}
int main() {
  file();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> stairs(cl);
  vector<long long> ele(ce);
  for (int i = 0; i < cl; i++) cin >> stairs[i];
  for (int i = 0; i < ((int)(ele).size()); i++) cin >> ele[i];
  stairs.push_back(1e12);
  ele.push_back(1e12);
  int q;
  cin >> q;
  while (q--) {
    pair<int, int> a, b;
    cin >> a.first >> a.second >> b.first >> b.second;
    long long firsts =
        *lower_bound(((stairs).begin()), ((stairs).end()), a.second);
    long long anss1 = abs(firsts - a.second);
    anss1 += abs(b.first - a.first);
    anss1 += abs(firsts - b.second);
    firsts = low(a.second, stairs);
    long long anss2 = abs(firsts - a.second);
    anss2 += abs(b.first - a.first);
    anss2 += abs(firsts - b.second);
    firsts = *lower_bound(((stairs).begin()), ((stairs).end()), b.second);
    long long anss3 = abs(firsts - a.second);
    anss3 += abs(b.first - a.first);
    anss3 += abs(firsts - b.second);
    firsts = low(b.second, stairs);
    long long anss4 = abs(firsts - a.second);
    anss4 += abs(b.first - a.first);
    anss4 += abs(firsts - b.second);
    long long anss = min(anss1, min(anss2, min(anss3, anss4)));
    firsts = *lower_bound(((ele).begin()), ((ele).end()), a.second);
    anss1 = abs(firsts - a.second);
    anss1 += abs(ceil((b.first - a.first) / double(v)));
    anss1 += abs(firsts - b.second);
    firsts = low(a.second, ele);
    anss2 = abs(firsts - a.second);
    anss2 += abs(ceil((b.first - a.first) / double(v)));
    anss2 += abs(firsts - b.second);
    firsts = *lower_bound(((ele).begin()), ((ele).end()), b.second);
    anss3 = abs(firsts - a.second);
    anss3 += abs(ceil((b.first - a.first) / double(v)));
    anss3 += abs(firsts - b.second);
    firsts = low(b.second, ele);
    anss4 = abs(firsts - a.second);
    anss4 += abs(ceil((b.first - a.first) / double(v)));
    anss4 += abs(firsts - b.second);
    long long anse = min(anss1, min(anss2, min(anss3, anss4)));
    cout << min(anss, anse) << endl;
  }
}
