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;
vector<long long int> a, b;
int main() {
  long long int ii, i, j, k, n, m, z = 0, c = 0, t, x, y, l, r, mid, u, v, d;
  cin >> n >> m >> d >> t >> v;
  for (i = 0; i < d; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (i = 0; i < t; i++) {
    cin >> x;
    b.push_back(x);
  }
  cin >> l;
  while (l--) {
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x = lower_bound(a.begin(), a.end(), y1) - a.begin();
    y = lower_bound(b.begin(), b.end(), y1) - b.begin();
    if (x == d) x--;
    if (y == t) y--;
    c = 1999999999;
    r = abs(y1 - y2);
    if (d) c = abs(a[x] - y1) + abs(x2 - x1) + abs(a[x] - y2);
    x--;
    if (x < 0) x = 0;
    if (d) c = min(c, abs(a[x] - y1) + abs(x2 - x1) + abs(a[x] - y2));
    z = (abs(x2 - x1) + v - 1) / v;
    if (t) c = min(c, abs(b[y] - y1) + abs(b[y] - y2) + z);
    y--;
    if (y < 0) y = 0;
    if (t) c = min(c, abs(b[y] - y1) + abs(b[y] - y2) + z);
    if (c == 1999999999) c = r;
    if (x1 == x2) c = r;
    cout << c << endl;
  }
}
