#include <bits/stdc++.h>
const long long N = 1e6 + 10;
const long long mod = 1e9 + 7;
long long dir[4][2] = {0, 1, 1, 0, 0, -1, -1, 0};
using namespace std;
long long l[N], e[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  srand(time(0));
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  for (long long i = 1; i <= cl; i++) cin >> l[i];
  for (long long i = 1; i <= ce; i++) cin >> e[i];
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    long long l1 = (1LL << 61), l2 = (1LL << 61), e1 = (1LL << 61),
              e2 = (1LL << 61);
    if (cl) {
      long long p = upper_bound(l + 1, l + 1 + cl, y1) - l;
      p = min(p, cl);
      l1 = 0;
      l1 += abs(y1 - l[p]);
      l1 += abs(x1 - x2);
      l1 += abs(y2 - l[p]);
      p--;
      p = max(p, 1LL);
      l2 = 0;
      l2 += abs(y1 - l[p]);
      l2 += abs(x1 - x2);
      l2 += abs(y2 - l[p]);
    }
    if (ce) {
      long long p = upper_bound(e + 1, e + 1 + ce, y1) - e;
      p = min(p, ce);
      e1 = 0;
      e1 += abs(y1 - e[p]);
      e1 += (abs(x1 - x2) + v - 1) / v;
      ;
      e1 += abs(y2 - e[p]);
      p--;
      p = max(p, 1LL);
      e2 = 0;
      e2 += abs(y1 - e[p]);
      e2 += (abs(x1 - x2) + v - 1) / v;
      ;
      e2 += abs(y2 - e[p]);
    }
    l1 = min(l1, l2);
    e1 = min(e1, e2);
    cout << min(l1, e1) << endl;
  }
  return 0;
}
