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;
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long powmod(long long a, long long b) {
  long long res = 1;
  if (a >= 1000000007) a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    if (res >= 1000000007) res %= 1000000007;
    a = a * a;
    if (a >= 1000000007) a %= 1000000007;
  }
  return res;
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
}
void fileIO() {
  freopen("input.in", "r", stdin);
  freopen("output1.txt", "w", stdout);
}
long long n, m, v, c, e, q, x1, y11, x2, y2, x, p1, p2;
vector<long long> s;
vector<long long> l;
pair<long long, long long> p[100005];
pair<long long, long long> pop[100005];
vector<long long>::iterator it1, it2;
int main() {
  cin >> n >> m >> c >> e >> v;
  s.clear();
  l.clear();
  for (int i = 0; i < c; i++) {
    cin >> x;
    s.push_back(x);
  }
  sort(s.begin(), s.end());
  for (int i = 0; i < e; i++) {
    cin >> x;
    l.push_back(x);
  }
  sort(l.begin(), l.end());
  cin >> q;
  long long r = q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> y11 >> x2 >> y2;
    p[i] = make_pair(x1, y11);
    pop[i] = make_pair(x2, y2);
  }
  for (int i = 0; i < q; i++) {
    x1 = p[i].first;
    y11 = p[i].second;
    x2 = pop[i].first;
    y2 = pop[i].second;
    if (x1 == x2) {
      cout << abs(y2 - y11) << "\n";
    } else {
      it1 = lower_bound(s.begin(), s.end(), y2);
      p1 = it1 - s.begin() - 1;
      it2 = upper_bound(s.begin(), s.end(), y2);
      p2 = it2 - s.begin();
      long long st = 1e17;
      if (!s.empty() && p1 >= 0) {
        st = min(st, abs(s[p1] - y2) + abs(s[p1] - y11) + abs(x1 - x2));
      }
      if (!s.empty() && it2 != s.end()) {
        st = min(st, abs(s[p2] - y2) + abs(s[p2] - y11) + abs(x1 - x2));
      }
      long long lf = 1e17;
      it1 = lower_bound(l.begin(), l.end(), y2);
      p1 = it1 - l.begin() - 1;
      it2 = upper_bound(l.begin(), l.end(), y2);
      p2 = it2 - l.begin();
      if (!l.empty() && p1 >= 0) {
        lf = min(lf, abs(l[p1] - y2) + abs(l[p1] - y11) +
                         ((abs(x1 - x2) % v) == 0
                              ? (abs(x1 - x2) / v)
                              : (abs(x1 - x2) / v + abs(x1 - x2) % v)));
      }
      if (!l.empty() && it2 != s.end()) {
        lf = min(lf, abs(l[p2] - y2) + abs(l[p2] - y11) +
                         ((abs(x1 - x2) % v) == 0
                              ? (abs(x1 - x2) / v)
                              : (abs(x1 - x2) / v + abs(x1 - x2) % v)));
      }
      cout << min(st, lf) << "\n";
    }
  }
  return 0;
}
