2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

#include <bits/stdc++.h>
using namespace std;
int n, m, v1, v2, v;
int a[100005], b[100005];
int Q, x, y, xx, yy;
int st, el;
void init() { freopen("c.in", "r", stdin); }
int get_a(int l, int r, int tot) {
  if (l == r)
    return l;
  else {
    int mid = (l + r) / 2;
    if (a[mid] > tot)
      return get_a(l, mid, tot);
    else
      return get_a(mid + 1, r, tot);
  }
}
int get_b(int l, int r, int tot) {
  if (l == r)
    return l;
  else {
    int mid = (l + r) / 2;
    if (b[mid] > tot)
      return get_b(l, mid, tot);
    else
      return get_b(mid + 1, r, tot);
  }
}
int pd() {
  if (abs(x - xx) % v)
    return 1;
  else
    return 0;
}
int get() {
  int ans;
  if (x == xx)
    ans = abs(y - yy);
  else
    ans = 2147483647 / 2;
  if (st != -1) {
    int left = abs(y - a[st]) + abs(yy - a[st]) + abs(x - xx);
    if (st < v1)
      left = min(left, abs(y - a[st + 1]) + abs(yy - a[st + 1]) + abs(x - xx));
    ans = min(ans, left);
  }
  if (el != -1) {
    int right = abs(y - b[el]) + abs(yy - b[el]) + abs(x - xx) / v + pd();
    if (el < v2)
      right = min(right, abs(y - b[el + 1]) + abs(yy - b[el + 1]) +
                             abs(x - xx) / v + pd());
    ans = min(ans, right);
  }
  return ans;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &v1, &v2, &v);
  for (int i = 1; i <= v1; i++) scanf("%d", &a[i]);
  sort(a + 1, a + v1 + 1);
  for (int i = 1; i <= v2; i++) scanf("%d", &b[i]);
  sort(b + 1, b + v2 + 1);
  a[v1 + 1] = b[v2 + 1] = -88888888;
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d%d%d%d", &x, &y, &xx, &yy);
    if (v1)
      st = get_a(1, v1, y);
    else
      st = -1;
    if (v2)
      el = get_b(1, v2, y);
    else
      el = -1;
    printf("%d\n", get());
  }
  return 0;
}
