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>
const int N = 1e6;
using namespace std;
int x, y, x2, y2;
int n, m, c1, c2, v, t1, t2, q;
int c[N], cc[N], l, r;
int main() {
  cin >> n >> m >> c1 >> c2 >> v;
  for (int i = 0; i < c1; i++) {
    scanf("%d", &c[i]);
  }
  for (int i = 0; i < c2; i++) {
    scanf("%d", &cc[i]);
  }
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &x);
    scanf("%d", &y);
    scanf("%d", &x2);
    scanf("%d", &y2);
    t1 = abs(x - x2);
    t2 = abs(y - y2);
    if (t1 == 0) {
      cout << t2 << endl;
    } else {
      int t3, t4;
      int ans = 0x3f3f3f3f;
      if (c1) {
        t3 = lower_bound(c, c + c1, y) - c;
        if (t3 == c1) t3--;
        ans = min(ans, t1 + abs(c[t3] - y) + abs(c[t3] - y2));
        if (t3 != 0)
          ans = min(ans, t1 + abs(c[t3 - 1] - y) + abs(c[t3 - 1] - y2));
      }
      if (c2) {
        t4 = lower_bound(cc, cc + c2, y) - cc;
        if (t4 == c2) t4--;
        ans = min(ans, abs(cc[t4] - y) + abs(cc[t4] - y2) +
                           (int)ceil(t1 / (double)v));
        if (t4 != 0)
          ans = min(ans, abs(cc[t4 - 1] - y) + abs(cc[t4 - 1] - y2) +
                             (int)ceil(t1 / (double)v));
      }
      cout << ans << endl;
    }
  }
  return 0;
}
