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;
int n, m, l, e, v, q;
vector<int> v1;
vector<int> v2;
int main() {
  cin >> n >> m >> l >> e >> v;
  for (int i = 1; i <= l; i++) {
    int a;
    cin >> a;
    v2.push_back(a);
  }
  for (int i = 1; i <= e; i++) {
    int a;
    cin >> a;
    v1.push_back(a);
  }
  cin >> q;
  for (int i = 1; i <= q; i++) {
    int x, y, x2, y2;
    cin >> x >> y >> x2 >> y2;
    auto it = lower_bound(v1.begin(), v1.end(), y);
    auto it2 = lower_bound(v2.begin(), v2.end(), y);
    int l = 0, r = 0, l2 = 0, r2 = 0;
    if (it != v1.end()) {
      r = *it;
    }
    if (it != v1.begin()) {
      it--;
      l = *it;
    }
    if (it2 != v2.end()) {
      r2 = *it2;
    }
    if (it2 != v2.begin()) {
      it2--;
      l2 = *it2;
    }
    long long sum = 1e9, sum2 = 1e9, sum3 = 1e9, sum4 = 1e9;
    if (r) {
      sum =
          abs(y - r) + (abs(x - x2) / v + (abs(x - x2) % v != 0)) + abs(y2 - r);
    }
    if (l) {
      sum2 =
          abs(y - l) + (abs(x - x2) / v + (abs(x - x2) % v != 0)) + abs(y2 - l);
    }
    if (r2) {
      sum3 = abs(y - r2) + abs(x - x2) + abs(y2 - r2);
    }
    if (l2) {
      sum4 = abs(y - l2) + abs(x - x2) + abs(y2 - l2);
    }
    cout << min(min(sum, min(sum2, min(sum3, sum4))),
                (x == x2 ? abs(y - y2) : (long long)1e9))
         << '\n';
  }
}
