#include <bits/stdc++.h>
using namespace std;
long long n, m, k, l, v, t, h, c, a1, b1, i, j, a, b;
vector<long long> vk, vl;
int main() {
  cin >> n >> m >> k >> l >> v;
  for (i = 0; i < k; i++) {
    cin >> a;
    vk.push_back(a);
  }
  sort(vk.begin(), vk.end());
  for (i = 0; i < l; i++) {
    cin >> a;
    vl.push_back(a);
  }
  sort(vl.begin(), vl.end());
  int q;
  cin >> q;
  while (q--) {
    scanf("%d%d%d%d", &b, &a, &b1, &a1);
    vector<long long>::iterator itk = lower_bound(vk.begin(), vk.end(), a);
    vector<long long>::iterator itl = lower_bound(vl.begin(), vl.end(), a);
    t = 1000000000000000000;
    if (b1 == b) t = abs(a - a1);
    h = abs(b1 - b);
    if (itk != vk.end()) {
      c = *itk;
      t = min(abs(c - a) + h + abs(c - a1), t);
    }
    if (itk != vk.begin()) {
      itk--;
      c = *itk;
      t = min(abs(c - a) + h + abs(c - a1), t);
    }
    if (itl != vl.end()) {
      c = *itl;
      t = min(t, abs(c - a) + (h + v - 1) / v + abs(c - a1));
    }
    if (itl != vl.begin()) {
      itl--;
      c = *itl;
      t = min(abs(c - a) + (h + v - 1) / v + abs(c - a1), t);
    }
    printf("%d\n", t);
  }
}
