#include <bits/stdc++.h>
using namespace std;
const long long int inf = 0x3f3f3f3f3f;
const int maxn = 1e5 + 5;
int c1[maxn];
int c2[maxn];
int n, m, s, e, v;
int main() {
  cin >> n >> m >> s >> e >> v;
  for (int i = 1; i <= s; i++) scanf("%d", &c1[i]);
  for (int i = 1; i <= e; i++) scanf("%d", &c2[i]);
  int x1, y1, x2, y2;
  int q;
  cin >> q;
  while (q--) {
    scanf("%d%d%d%d", &y1, &x1, &y2, &x2);
    if (y1 == y2)
      cout << abs(x2 - x1) << endl;
    else {
      long long int ans = inf;
      int pos1 = lower_bound(c1 + 1, c1 + 1 + s, x1) - c1;
      if (pos1 > 1)
        ans = min(ans, (long long int)abs(x1 - c1[pos1 - 1]) +
                           abs(x2 - c1[pos1 - 1]) + abs(y2 - y1));
      if (pos1 <= s)
        ans = min(ans, (long long int)abs(c1[pos1] - x1) + abs(x2 - c1[pos1]) +
                           abs(y2 - y1));
      int pos2 = lower_bound(c2 + 1, c2 + 1 + e, x1) - c2;
      if (pos2 > 1)
        ans = min(ans, (long long int)abs(x1 - c2[pos2 - 1]) +
                           abs(x2 - c2[pos2 - 1]) + (abs(y2 - y1) + v - 1) / v);
      if (pos2 <= e)
        ans = min(ans, (long long int)abs(c2[pos2] - x1) + abs(x2 - c2[pos2]) +
                           (abs(y2 - y1) + v - 1) / v);
      cout << ans << endl;
    }
  }
  return 0;
}
