#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long n, m, l, s, vl[100002], vs[100002], spl;
long long q, xa, ya, xb, yb;
long long bls(long long nr) {
  if (nr < vl[1]) return -1;
  int b = 1;
  int e = l;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vl[mid] <= nr)
      sol = vl[mid], b = mid + 1;
    else
      e = mid - 1;
  }
  return sol;
}
long long blr(long long nr) {
  if (nr > vl[l]) return -1;
  int b = 1;
  int e = l;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vl[mid] >= nr)
      sol = vl[mid], e = mid - 1;
    else
      b = mid + 1;
  }
  return sol;
}
long long bss(long long nr) {
  if (nr < vs[1]) return -1;
  int b = 1;
  int e = s;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vs[mid] <= nr)
      sol = vs[mid], b = mid + 1;
    else
      e = mid - 1;
  }
  return sol;
}
long long bsr(long long nr) {
  if (nr > vs[s]) return -1;
  int b = 1;
  int e = s;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vs[mid] >= nr)
      sol = vs[mid], e = mid - 1;
    else
      b = mid + 1;
  }
  return sol;
}
long long solve(long long xa, long long ya, long long xb, long long yb) {
  long long mint = (1LL << 60);
  if (bss(ya) != -1)
    mint = min(mint, ya - bss(ya) + (xb - xa) + abs(bss(ya) - yb));
  if (bsr(ya) != -1)
    mint = min(mint, bsr(ya) - ya + (xb - xa) + abs(bsr(ya) - yb));
  long long tt = (xb - xa) / spl + (((xb - xa) % spl) > 0);
  if (bls(ya) != -1) mint = min(mint, ya - bls(ya) + tt + abs(bls(ya) - yb));
  if (blr(ya) != -1) mint = min(mint, blr(ya) - ya + tt + abs(blr(ya) - yb));
  return mint;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> s >> l >> spl;
  for (int i = 1; i <= s; ++i) cin >> vs[i];
  for (int i = 1; i <= l; ++i) cin >> vl[i];
  cin >> q;
  for (int i = 1; i <= q; ++i) {
    cin >> xa >> ya >> xb >> yb;
    if (xa > xb) {
      swap(xa, xb);
      swap(ya, yb);
    } else if (xa == xb && ya > yb)
      swap(ya, yb);
    if (xa == xb)
      cout << yb - ya << '\n';
    else
      cout << solve(xa, ya, xb, yb) << '\n';
  }
  return 0;
}
