#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int a[100005];
int b[100005];
int main() {
  long long n, m, nn, mm, v;
  cin >> n >> m >> nn >> mm >> v;
  for (int i = 0; i < nn; ++i) cin >> a[i];
  for (int i = 0; i < mm; ++i) cin >> b[i];
  int q;
  cin >> q;
  long long sx, sy, ex, ey;
  for (int i = 0; i < q; ++i) {
    cin >> sx >> sy >> ex >> ey;
    long long mmin = 0x3f3f3f3f;
    int pos1 = lower_bound(a, a + nn, sy) - a;
    int pos2 = lower_bound(b, b + mm, sy) - b;
    if (pos1 > 0)
      mmin = min(mmin,
                 abs(sy - a[pos1 - 1]) + abs(ey - a[pos1 - 1]) + abs(ex - sx));
    if (pos1 < nn)
      mmin = min(mmin, abs(a[pos1] - sy) + abs(ey - a[pos1]) + abs(ex - sx));
    if (pos2 > 0)
      mmin = min(mmin, abs(sy - b[pos2 - 1]) + abs(ey - b[pos2 - 1]) +
                           (long long)ceil(1.0 * abs(ex - sx) / v));
    if (pos2 < mm)
      mmin = min(mmin, abs(b[pos2] - sy) + abs(ey - b[pos2]) +
                           (long long)ceil(1.0 * abs(ex - sx) / v));
    if (sx == ex) mmin = abs(sy - ey);
    cout << mmin << endl;
  }
  return 0;
}
