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, cl, ce, v;
int l[100010], e[100010];
int Q;
int *find_max(int *a, int *b, const int val) {
  if (*a > val) return b;
  int *mid = a + (b - a) / 2;
  while (b > a) {
    if (*mid >= val)
      b = mid;
    else if (*mid < val)
      a = mid + 1;
    mid = a + (b - a) / 2;
  }
  return mid;
}
int *find_min(int *a, int *b, const int val) {
  if (*(b - 1) < val) return b;
  int *mid = a + (b - a) / 2;
  while (b > a) {
    if (*mid > val)
      b = mid;
    else if (*mid <= val)
      a = mid + 1;
    mid = a + (b - a) / 2;
  }
  return mid;
}
int dis_e(int le, int r) {
  if (ce == 0)
    return -1;
  else {
    int *pos1, *pos2;
    pos1 = find_max(e, e + ce, r);
    pos2 = find_min(e, e + ce, le);
    if (pos1 == e + ce) {
      return abs(r - *pos2) + abs(le - *pos2);
    } else if (pos2 == e + ce) {
      return abs(r - *pos1) + abs(le - *pos1);
    } else {
      return min(abs(r - *pos1) + abs(le - *pos1),
                 abs(r - *pos2) + abs(le - *pos2));
    }
  }
}
int dis_l(int le, int r) {
  if (cl == 0)
    return -1;
  else {
    int *pos1, *pos2;
    pos1 = find_max(l, l + cl, r);
    pos2 = find_min(l, l + cl, le);
    if (pos1 == l + cl) {
      return abs(r - *pos2) + abs(le - *pos2);
    } else if (pos2 == l + cl) {
      return abs(r - *pos1) + abs(le - *pos1);
    } else {
      return min(abs(r - *pos1) + abs(le - *pos1),
                 abs(r - *pos2) + abs(le - *pos2));
    }
  }
}
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) cin >> l[i];
  for (int i = 0; i < ce; i++) cin >> e[i];
  cin >> Q;
  while (Q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int min_e = dis_e(min(y1, y2), max(y1, y2)),
        min_l = dis_l(min(y1, y2), max(y1, y2));
    if (min_e == -1) {
      cout << abs(x1 - x2) + min_l << '\n';
    } else if (min_l == -1) {
      cout << (abs(x1 - x2) + v - 1) / v + min_e << '\n';
    } else {
      cout << min(abs(x1 - x2) + min_l, (abs(x1 - x2) + v - 1) / v + min_e)
           << '\n';
    }
  }
  return 0;
}
