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;
template <class T>
T sqr(const T &a) {
  return a * a;
}
const int MAXN = 2e5 + 100;
int n, m, cntA, cntB, v, x1, aasdfasdfasdf, x2, y2;
int a[MAXN], b[MAXN];
int calcA(int pos) {
  if (pos < 0 || pos >= cntA) return 2e9;
  return abs(a[pos] - x1) + abs(aasdfasdfasdf - y2) + abs(a[pos] - x2);
}
int calcB(int pos) {
  if (pos < 0 || pos >= cntB) return 2e9;
  return abs(b[pos] - x1) + (abs(aasdfasdfasdf - y2) + v - 1) / v +
         abs(b[pos] - x2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  scanf("%d%d%d%d%d", &n, &m, &cntA, &cntB, &v);
  for (int i = 0; i < (cntA); i++) scanf("%d", &a[i]);
  for (int i = 0; i < (cntB); i++) scanf("%d", &b[i]);
  int q;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &aasdfasdfasdf, &x1, &y2, &x2);
    int pos1 = lower_bound(a, a + cntA, x1) - a;
    int pos2 = lower_bound(b, b + cntB, x1) - b;
    if (aasdfasdfasdf == y2)
      printf("%d\n", abs(x1 - x2));
    else
      printf(
          "%d\n",
          min(min(min(min(min(calcA(pos1 - 1), calcA(pos1)), calcA(pos1 + 1)),
                      calcB(pos2 - 1)),
                  calcB(pos2)),
              calcB(pos2 + 1)));
  }
}
