#include <bits/stdc++.h>
using namespace std;
const int len = 1e5 + 5;
const long long mod = 998244353;
const unsigned long long seed = 131;
int l[len], e[len];
int main() {
  int n, m, x, y, v;
  cin >> n >> m >> x >> y >> v;
  for (int i = 0; i < x; ++i) scanf("%d", &l[i]);
  for (int i = 0; i < y; ++i) scanf("%d", &e[i]);
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 == x2)
      printf("%d\n", abs(y1 - y2));
    else {
      int a = 1e9, b = 1e9;
      int p = upper_bound(l, l + x, y1) - l;
      a = abs(l[p] - y1) + abs(x1 - x2) + abs(l[p] - y2);
      if (p != 0) {
        p--;
        b = abs(l[p] - y1) + abs(x1 - x2) + abs(l[p] - y2);
      }
      int c = 1e9, d = 1e9;
      p = upper_bound(e, e + y, y1) - e;
      c = abs(e[p] - y1) + (abs(x1 - x2) + v - 1) / v + abs(e[p] - y2);
      if (p != 0) {
        p--;
        d = abs(e[p] - y1) + (abs(x1 - x2) + v - 1) / v + abs(e[p] - y2);
      }
      int ans = 1e9;
      if (x != 0) ans = min(ans, min(a, b));
      if (y != 0) ans = min(ans, min(c, d));
      printf("%d\n", ans);
    }
  }
}
