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>
#pragma GCC optimize("O3")
using namespace std;
inline int minn(int x, int y) { return x < y ? x : y; }
const int ma = 100001;
int l[ma], e[ma];
int main() {
  ios::sync_with_stdio(false);
  int n, m, cl, ce, v, q;
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 1; i <= cl; ++i) cin >> l[i];
  for (int i = 1; i <= ce; ++i) cin >> e[i];
  cin >> q;
  while (q--) {
    int x1, x2, y1, y2, x = 400000000, y = 400000000;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      printf("%d", abs(y1 - y2));
      continue;
    }
    if (cl > 0) {
      int a = lower_bound(l + 1, l + cl + 1, y1) - l,
          b = lower_bound(l + 1, l + cl + 1, y2) - l;
      if (a > cl)
        x = minn(x, abs(l[cl] - y1) + abs(l[cl] - y2));
      else {
        x = minn(x, abs(l[a] - y1) + abs(l[a] - y2));
        if (a > 0) x = minn(x, abs(l[a - 1] - y1) + abs(l[a - 1] - y2));
      }
      if (b > cl)
        x = minn(x, abs(l[cl] - y1) + abs(l[cl] - y2));
      else {
        x = minn(x, abs(l[b] - y1) + abs(l[b] - y2));
        if (b > 0) x = minn(x, abs(l[b - 1] - y1) + abs(l[b - 1] - y2));
      }
      x += abs(x1 - x2);
    }
    if (ce > 0) {
      int a = lower_bound(e + 1, e + ce + 1, y1) - e,
          b = lower_bound(e + 1, e + ce + 1, y2) - e;
      if (a > ce)
        y = minn(y, abs(e[ce] - y1) + abs(e[ce] - y2));
      else {
        y = minn(y, abs(e[a] - y1) + abs(e[a] - y2));
        if (a > 0) y = minn(y, abs(e[a - 1] - y1) + abs(e[a - 1] - y2));
      }
      if (b > ce)
        y = minn(y, abs(e[ce] - y1) + abs(e[ce] - y2));
      else {
        y = minn(y, abs(e[b] - y1) + abs(e[b] - y2));
        if (b > 0) y = minn(y, abs(e[b - 1] - y1) + abs(e[b - 1] - y2));
      }
      int z = abs(x1 - x2);
      y += z / v;
      if (z % v != 0) ++y;
    }
    printf("%d\n", minn(x, y));
  }
}
