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;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char& ch) {
  string s = "";
  s += ch;
  return "'" + s + "', ";
}
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
const long long mod = (long long)1000000007;
const long long inf = 1e16;
const long long maxn = 2e5;
long long n, m, ncl, nce, v;
vector<long long> cl, ce;
long long check(long long ind, long long n) { return ind >= 0 && ind < n; }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(9);
  cin >> n >> m >> ncl >> nce >> v;
  cl.resize(ncl);
  ce.resize(nce);
  for (long long i = 0; i < ncl; ++i) cin >> cl[i];
  for (long long i = 0; i < nce; ++i) cin >> ce[i];
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long mn = inf;
    if (x1 == x2) {
      cout << abs(y2 - y1) << '\n';
      continue;
    }
    long long sta = lower_bound(cl.begin(), cl.end(), y1) - cl.begin();
    if (check(sta, ncl)) {
      long long cur = abs(x2 - x1) + abs(cl[sta] - y2) + abs(cl[sta] - y1);
      mn = min(mn, cur);
    }
    --sta;
    if (check(sta, ncl)) {
      long long cur = abs(x2 - x1) + abs(cl[sta] - y2) + abs(cl[sta] - y1);
      mn = min(mn, cur);
    }
    long long ele = lower_bound(ce.begin(), ce.end(), y1) - ce.begin();
    if (check(ele, nce)) {
      long long is = (abs(x2 - x1) + v - 1) / v;
      long long cur = is + abs(ce[ele] - y2) + abs(ce[ele] - y1);
      mn = min(mn, cur);
    }
    --ele;
    if (check(ele, nce)) {
      long long is = (abs(x2 - x1) + v - 1) / v;
      long long cur = is + abs(ce[ele] - y2) + abs(ce[ele] - y1);
      mn = min(mn, cur);
    }
    cout << mn << '\n';
  }
  return 0;
}
