#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 5;
template <class X>
inline void read(X &x) {
  X f = 1;
  char ch = getchar();
  x = 0;
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  x *= f;
}
template <class X>
inline void print(X x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) print(x / 10);
  putchar(x % 10 + 48);
}
int n, m, lct, ect, v;
int l[MAXN], e[MAXN];
inline int search_e(int x) {
  int ll = 1, rr = ect, mid;
  while (ll < rr) {
    mid = (ll + rr) >> 1;
    if (e[mid] > x)
      rr = mid;
    else
      ll = mid + 1;
  }
  if (ll > ect)
    return ect;
  else if (ll < 1)
    return 1;
  else
    return ll;
}
inline int search_l(int x) {
  int ll = 1, rr = lct, mid;
  while (ll < rr) {
    mid = (ll + rr) >> 1;
    if (l[mid] > x)
      rr = mid;
    else
      ll = mid + 1;
  }
  if (ll > lct)
    return lct;
  else if (ll < 1)
    return 1;
  else
    return ll;
}
int main() {
  read(n);
  read(m);
  read(lct);
  read(ect);
  read(v);
  for (int i = 1; i <= lct; ++i) read(l[i]);
  for (int i = 1; i <= ect; ++i) read(e[i]);
  int q;
  read(q);
  for (int i = 1; i <= q; ++i) {
    int x1, x2, y1, y2, ans = INT_MAX;
    read(x1);
    read(y1);
    read(x2);
    read(y2);
    if (y1 > y2) {
      swap(y1, y2);
      swap(x1, x2);
    }
    if (x1 == x2) {
      print(abs(y1 - y2));
      puts("");
      continue;
    }
    if (lct != 0) {
      int pos_l = search_l(y1);
      int x = l[pos_l], y, z;
      if (pos_l + 1 <= lct)
        y = l[pos_l + 1];
      else
        y = x;
      if (pos_l - 1 >= 1)
        z = l[pos_l - 1];
      else
        z = x;
      ans = min(ans, abs(y1 - x) + abs(x1 - x2) + abs(y2 - x));
      ans = min(ans, abs(y1 - y) + abs(x1 - x2) + abs(y2 - y));
      ans = min(ans, abs(y1 - z) + abs(x1 - x2) + abs(y2 - z));
    }
    if (ect != 0) {
      int pos_e = search_e(y1);
      int xx = e[pos_e], yy, zz;
      if (pos_e + 1 <= ect)
        yy = e[pos_e + 1];
      else
        yy = xx;
      if (pos_e - 1 >= 1)
        zz = e[pos_e - 1];
      else
        zz = xx;
      int cost = abs(x1 - x2) / v;
      if (abs(x1 - x2) % v != 0) cost += 1;
      ans = min(ans, abs(y1 - xx) + cost + abs(y2 - xx));
      ans = min(ans, abs(y1 - yy) + cost + abs(y2 - yy));
      ans = min(ans, abs(y1 - zz) + cost + abs(y2 - zz));
    }
    print(ans);
    puts("");
  }
  return 0;
}
