#include <bits/stdc++.h>
using namespace std;
vector<int> ast, lift;
int main() {
  int n, m, ca, cl, v;
  scanf("%d%d%d%d%d", &n, &m, &ca, &cl, &v);
  for (int i = 0; i < ca; i++) {
    int k;
    scanf("%d", &k);
    ast.push_back(k);
  }
  for (int i = 0; i < cl; i++) {
    int k;
    scanf("%d", &k);
    lift.push_back(k);
  }
  sort(ast.begin(), ast.end());
  sort(lift.begin(), lift.end());
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (y1 > y2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    if (x1 == x2) {
      printf("%d\n", max(y1 - y2, y2 - y1));
      continue;
    }
    int ans = 1000 * 1000 * 1000 + 1000;
    int l = -1, r = lift.size();
    while (r - l > 1) {
      int tm = (l + r) / 2;
      if (lift[tm] <= y1)
        l = tm;
      else
        r = tm;
    }
    if (lift.size() != 0) {
      if (l != -1) {
        int hans = abs(y1 - lift[l]) + abs(y2 - lift[l]);
        hans += (abs(x2 - x1) + v - 1) / v;
        ans = min(ans, hans);
      }
      if (l != lift.size() - 1) {
        l++;
        int hans = abs(y1 - lift[l]) + abs(y2 - lift[l]);
        hans += (abs(x2 - x1) + v - 1) / v;
        ans = min(ans, hans);
      }
    }
    l = -1, r = ast.size();
    while (r - l > 1) {
      int tm = (l + r) / 2;
      if (ast[tm] <= y1)
        l = tm;
      else
        r = tm;
    }
    if (ast.size() != 0) {
      if (l != -1) {
        int hans = abs(y1 - ast[l]) + abs(y2 - ast[l]);
        hans += (abs(x2 - x1));
        ans = min(ans, hans);
      }
      if (l != ast.size() - 1) {
        l++;
        int hans = abs(y1 - ast[l]) + abs(y2 - ast[l]);
        hans += (abs(x2 - x1));
        ans = min(ans, hans);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
