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 long M = 0x3f3f3f3f;
long s[100010], e[100010];
int main() {
  long n, m, c1, c2, v, i, j, t, q, xs, ys, xe, ye, r, r1, r2, re, g, c;
  cin >> n >> m >> c1 >> c2 >> v;
  for (i = 1; i <= c1; i++) {
    cin >> s[i];
  }
  for (i = 1; i <= c2; i++) {
    cin >> e[i];
  }
  cin >> q;
  for (j = 0; j < q; j++) {
    cin >> xs >> ys >> xe >> ye;
    re = M;
    if (c1 > 0) {
      r1 = lower_bound(s + 1, s + c1 + 1, ys) - s;
      if (r1 <= c1 && r1 > 0) {
        g = s[r1];
        r = abs(g - ys) + abs(g - ye) + abs(xe - xs);
        if (r < re) {
          re = r;
        }
      }
      r2 = r1 - 1;
      if (r2 > 0 && r2 <= c1) {
        g = s[r2];
        r = abs(g - ys) + abs(g - ye) + abs(xe - xs);
        if (r < re) {
          re = r;
        }
      }
    }
    if (c2 > 0) {
      r1 = lower_bound(e + 1, e + c2 + 1, ys) - e;
      if (r1 <= c2 && r1 > 0) {
        g = e[r1];
        r = abs(g - ys) + abs(g - ye);
        t = abs(xe - xs);
        if (t % v == 0) {
          c = t / v;
        } else {
          c = (t / v) + 1;
        }
        r = r + c;
        if (r < re) {
          re = r;
        }
      }
      r2 = r1 - 1;
      if (r2 > 0 && r2 <= c2) {
        g = e[r2];
        r = abs(g - ys) + abs(g - ye);
        t = abs(xe - xs);
        if (t % v == 0) {
          c = t / v;
        } else {
          c = (t / v) + 1;
        }
        r = r + c;
        if (r < re) {
          re = r;
        }
      }
    }
    if (xs == xe) {
      re = abs(ys - ye);
    }
    cout << re << endl;
  }
}
