#include <bits/stdc++.h>
using namespace std;
long long n, m, cl, ce, v;
vector<long long> s, e;
long long walk(long long x1, long long y1, long long x2, long long y2) {
  long long ans = 1e18;
  long long val = m - y1 + m - y2 + abs(x1 - x2);
  ans = min(ans, val);
  val = y1 - 1 + y2 - 1 + abs(x1 - x2);
  ans = min(ans, val);
  return ans;
}
long long stair(long long x1, long long y1, long long x2, long long y2) {
  long long val, ans = 1e18;
  long long ub = upper_bound(s.begin(), s.end(), y1) - s.begin();
  if (ub != s.size()) {
    long long pos = s[ub];
    val = pos - y1 + abs(pos - y2) + abs(x1 - x2);
    ans = min(ans, val);
  }
  long long lb = ub - 1;
  if (lb >= 0) {
    long long pos = s[lb];
    val = y1 - pos + abs(pos - y2) + abs(x1 - x2);
    ans = min(ans, val);
  }
  return ans;
}
long long ele(long long x1, long long y1, long long x2, long long y2) {
  long long ans = 1e18;
  long long ub = upper_bound(e.begin(), e.end(), y1) - e.begin();
  if (ub != e.size()) {
    long long pos = e[ub];
    long long diff = abs(x1 - x2);
    long long x = diff / v;
    long long t;
    if (x2 > x1)
      t = (v * x) + x1;
    else
      t = x1 - (v * x);
    long long val = pos - y1 + x;
    if (t != x2)
      ans = min(ans, val + stair(t, pos, x2, y2));
    else
      ans = min(ans, val + abs(pos - y2));
    x++;
    t = x2;
    val = pos - y1 + x + abs(pos - y2);
    ans = min(ans, val);
  }
  long long lb = ub - 1;
  if (lb >= 0) {
    long long pos = e[lb];
    long long diff = abs(x1 - x2);
    long long x = diff / v;
    long long t;
    if (x2 > x1)
      t = (v * x) + x1;
    else
      t = x1 - (v * x);
    long long val = y1 - pos + x;
    if (t != x2)
      ans = min(ans, val + stair(t, pos, x2, y2));
    else
      ans = min(ans, val + abs(pos - y2));
    x++;
    t = x2;
    val = y1 - pos + x + abs(pos - y2);
    ans = min(ans, val);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> cl >> ce >> v;
  long long i, x;
  for (i = 0; i < cl; i++) {
    cin >> x;
    s.push_back(x);
  }
  for (i = 0; i < ce; i++) {
    cin >> x;
    e.push_back(x);
  }
  long long q, x1, y1, x2, y2;
  cin >> q;
  while (q--) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2)
      cout << abs(y1 - y2);
    else {
      long long ans = 1e18;
      ans = min(ans, stair(x1, y1, x2, y2));
      ans = min(ans, ele(x1, y1, x2, y2));
      cout << ans;
    }
    cout << "\n";
  }
  return 0;
}
