#include <bits/stdc++.h>
using namespace std;
const int N = 1E5 + 10;
const int INF = 1E9 + 7;
int n, m, c1, c2, k;
int a[N], b[N];
void Read_Input() {
  scanf("%d %d %d %d %d", &n, &m, &c1, &c2, &k);
  for (int i = 1; i <= c1; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= c2; i++) scanf("%d", &b[i]);
}
int BS1(int x, int a[], int n) {
  int l = 1, h = n, mid;
  int ret = -1;
  while (l <= h) {
    mid = (l + h) >> 1;
    if (a[mid] <= x) {
      ret = mid;
      l = mid + 1;
    } else
      h = mid - 1;
  }
  return ret;
}
int BS2(int x, int a[], int n) {
  int l = 1, h = n, mid;
  int ret = -1;
  while (l <= h) {
    mid = (l + h) >> 1;
    if (a[mid] >= x) {
      ret = mid;
      h = mid - 1;
    } else
      l = mid + 1;
  }
  return ret;
}
int CalStair(int x, int y, int u, int v) {
  int l = BS1(y, a, c1);
  int r = BS2(y, a, c1);
  int diff = INF;
  if (l != -1) diff = min(diff, abs(y - a[l]) + abs(a[l] - v) + abs(x - u));
  if (r != -1) diff = min(diff, abs(y - a[r]) + abs(a[r] - v) + abs(x - u));
  return diff;
}
int CalElevator(int x, int y, int u, int v) {
  int l = BS1(y, b, c2);
  int r = BS2(y, b, c2);
  int diff = INF;
  int step = ceil(abs(x - u) / (1.0 * k));
  if (l != -1) diff = min(diff, abs(y - b[l]) + abs(b[l] - v) + step);
  if (r != -1) diff = min(diff, abs(y - b[r]) + abs(b[r] - v) + step);
  return diff;
}
void Solve() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int x, y, u, v;
    scanf("%d %d %d %d", &x, &y, &u, &v);
    int ret1 = min(CalStair(x, y, u, v), CalStair(u, v, x, y));
    int ret2 = min(CalElevator(x, y, u, v), CalElevator(u, v, x, y));
    int ans = min(ret1, ret2);
    if (x == u) ans = abs(y - v);
    printf("%d\n", ans);
  }
}
int main() {
  Read_Input();
  Solve();
  return 0;
}
