#include <bits/stdc++.h>
using namespace std;
long long n, m, c1, c2, v, q;
long long xs, xe, ye, ys;
long long pos1[100005];
long long pos2[100005];
long long solve(int pos, int v) {
  long long ans = abs(pos - xe) + abs(pos - xs);
  long long y = abs(ye - ys);
  ans += (y - 1) / v + 1;
  return ans;
}
int main() {
  cin >> n >> m >> c1 >> c2 >> v;
  for (int i = 0; i < c1; i++) cin >> pos1[i];
  for (int i = 0; i < c2; i++) cin >> pos2[i];
  cin >> q;
  while (q--) {
    int id;
    cin >> ys >> xs >> ye >> xe;
    long long ans = 999999999999;
    if (ys == ye)
      ans = abs(xe - xs);
    else {
      if (c1) {
        id = upper_bound(pos1, pos1 + c1, xs) - pos1;
        if (id != c1) ans = min(ans, solve(pos1[id], 1));
        if (id - 1 >= 0) ans = min(ans, solve(pos1[id - 1], 1));
        id = upper_bound(pos1, pos1 + c1, xe) - pos1;
        if (id != c1) ans = min(ans, solve(pos1[id], 1));
        if (id - 1 >= 0) ans = min(ans, solve(pos1[id - 1], 1));
      }
      if (c2) {
        id = upper_bound(pos2, pos2 + c2, xs) - pos2;
        if (id != c2) ans = min(ans, solve(pos2[id], v));
        if (id - 1 >= 0) ans = min(ans, solve(pos2[id - 1], v));
        id = upper_bound(pos2, pos2 + c2, xe) - pos2;
        if (id != c2) ans = min(ans, solve(pos2[id], v));
        if (id - 1 >= 0) ans = min(ans, solve(pos2[id - 1], v));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
