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;
const int maxn = 1e5 + 7;
int e[maxn], l[maxn];
int n, m, v;
int e1, e2;
int getnum1(int ll, int rr) {
  int left = min(ll, rr), right = max(ll, rr);
  ll = 1, rr = e1;
  while (ll < rr) {
    int mid = (ll + rr) / 2;
    if (l[mid] > right)
      rr = mid;
    else if (l[mid] < left)
      ll = mid + 1;
    else
      return mid;
  }
  return rr;
}
int getnum2(int ll, int rr) {
  int left = min(ll, rr), right = max(ll, rr);
  ll = 1, rr = e2;
  while (ll < rr) {
    int mid = (ll + rr) / 2;
    if (e[mid] > right)
      rr = mid;
    else if (e[mid] < left)
      ll = mid + 1;
    else
      return mid;
  }
  return rr;
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%d%d%d", &e1, &e2, &v);
  for (int i = 1; i <= e1; i++) {
    scanf("%d", &l[i]);
  }
  for (int i = 1; i <= e2; i++) {
    scanf("%d", &e[i]);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, x2, y1, y2;
    int ans = 0x3f3f3f3f;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int k1 = getnum1(y1, y2);
    int k2 = getnum2(y1, y2);
    int num1 = 0, num2 = 0;
    num1 = abs(l[k1] - y1) + abs(l[k1] - y2);
    if (k1 > 1) num1 = min(num1, abs(l[k1 - 1] - y1) + abs(l[k1 - 1] - y2));
    ans = num1 + abs(x1 - x2);
    num1 = abs(e[k2] - y1) + abs(e[k2] - y2);
    if (k2 > 1) num1 = min(num1, abs(e[k2 - 1] - y1) + abs(e[k2 - 1] - y2));
    num2 = abs(x1 - x2);
    if (num2 % v != 0)
      num2 = num2 / v + 1;
    else
      num2 = num2 / v;
    ans = min(ans, num1 + num2);
    printf("%d\n", ans);
  }
}
