#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
int n, m, cl, ce, v, q, x1, x2, ya, y2, ans1, ans2;
int S[(int)1e5], E[(int)1e5];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < ce; i++) {
    cin >> E[i];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> ans1 >> x2 >> ans2;
    ya = min(ans1, ans2);
    y2 = max(ans1, ans2);
    int t1, t2;
    t1 = lower_bound(S, S + cl, ya) - S;
    t2 = lower_bound(E, E + ce, ya) - E;
    if (t1 < cl) {
      if (S[t1] > y2) {
        ans1 = 2 * (S[t1] - y2);
        if (t1 > 0) {
          ans1 = min(ans1, 2 * (ya - S[t1 - 1]));
        }
      } else
        ans1 = 0;
    } else
      ans1 = 2 * (ya - S[cl - 1]);
    if (t2 < ce) {
      if (E[t2] > y2) {
        ans2 = 2 * (E[t2] - y2);
        if (t2 > 0) {
          ans2 = min(ans2, 2 * (ya - E[t2 - 1]));
        }
      } else
        ans2 = 0;
    } else
      ans2 = 2 * (ya - E[ce - 1]);
    if (cl == 0) ans1 = (int)1e9;
    if (ce == 0) ans2 = (int)1e9;
    x2 = abs(x2 - x1);
    if (x2 == 0) {
      cout << y2 - ya << "\n";
      continue;
    }
    ans1 = ans1 + x2 + y2 - ya;
    if (x2 % v == 0)
      ans2 = ans2 + y2 - ya + x2 / v;
    else
      ans2 = ans2 + y2 - ya + x2 / v + 1;
    cout << min(ans1, ans2) << "\n";
  }
  return 0;
}
