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>
void Open() {
  freopen(
      "txt"
      ".in",
      "r", stdin);
  freopen(
      "txt"
      ".out",
      "w", stdout);
}
void Close() {
  fclose(stdin);
  fclose(stdout);
}
using namespace std;
int Read() {
  int val = 0, opt = 1;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') opt = -1;
  while (isdigit(ch)) (val *= 10) += ch - '0', ch = getchar();
  return val * opt;
}
int n, m, cl, ce, v;
int l[100100], e[100100];
void Find(int x1, int y1, int x2, int y2) {
  int Ans = INT_MAX, p, t = abs(x2 - x1);
  if (!t) {
    printf("%d", abs(y1 - y2));
    return;
  }
  if (y1 > y2) swap(y1, y2);
  if (cl) {
    p = lower_bound(l + 1, l + 1 + cl, y1) - l - 1;
    if (!p) p++;
    if (l[p] < y1) Ans = min(Ans, y2 - y1 + 2 * (y1 - l[p]) + t);
    if (l[p] >= y1 && l[p] <= y2) Ans = min(Ans, y2 - y1 + t);
    if (l[p] > y2) Ans = min(Ans, y2 - y1 + 2 * (l[p] - y2) + t);
    p--;
    if (p && l[p] < y1) Ans = min(Ans, y2 - y1 + 2 * (y1 - l[p]) + t);
    p = upper_bound(l + 1, l + 1 + cl, y2) - l;
    if (p <= cl) Ans = min(Ans, y2 - y1 + 2 * (l[p] - y1) + t);
  }
  if (ce) {
    p = lower_bound(e + 1, e + 1 + ce, y1) - e - 1;
    if (!p) p++;
    if (e[p] < y1) Ans = min(Ans, y2 - y1 + 2 * (y1 - e[p]) + (t - 1) / v + 1);
    if (e[p] >= y1 && e[p] <= y2) Ans = min(Ans, y2 - y1 + (t - 1) / v + 1);
    if (e[p] > y2) Ans = min(Ans, y2 - y1 + 2 * (e[p] - y2) + (t - 1) / v + 1);
    p--;
    if (p && e[p] < y1)
      Ans = min(Ans, y2 - y1 + 2 * (y1 - e[p]) + (t - 1) / v + 1);
    p = upper_bound(e + 1, e + 1 + ce, y2) - e;
    if (p <= ce) Ans = min(Ans, y2 - y1 + 2 * (e[p] - y1) + (t - 1) / v + 1);
  }
  printf("%d\n", Ans);
}
void work() {
  n = Read(), m = Read(), cl = Read(), ce = Read(), v = Read();
  for (int i = 1; i <= cl; i++) l[i] = Read();
  for (int i = 1; i <= ce; i++) e[i] = Read();
  int x, y, s, t;
  for (int q = Read(); q; q--) {
    x = Read(), y = Read(), s = Read(), t = Read();
    Find(x, y, s, t);
  }
}
int main(void) {
  work();
  return 0;
}
