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 int MAX = 1000000009;
int n, m, cl, ce, v, q, a, r;
vector<int> l, e;
int x_1, y_1, x_2, y_2;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    cin >> a;
    l.push_back(a);
  }
  for (int i = 0; i < ce; i++) {
    cin >> a;
    e.push_back(a);
  }
  cin >> q;
  while (q-- > 0) {
    cin >> x_1 >> y_1 >> x_2 >> y_2;
    if (x_1 == x_2) {
      cout << abs(y_2 - y_1) << endl;
      continue;
    }
    vector<int>::iterator next, last;
    r = MAX;
    if (e.size() != 0) {
      next = upper_bound(e.begin(), e.end() + 1, y_1);
      last = next - 1;
      if (e[next - e.begin()] != 0) {
        r = min(r, (int)(abs(e[next - e.begin()] - y_1) +
                         ceil((double)(abs(x_2 - x_1)) / v) +
                         abs(e[next - e.begin()] - y_2)));
        if (e[last - e.begin()] != 0)
          r = min(r, (int)(abs(y_1 - e[last - e.begin()]) +
                           ceil((double)(abs(x_2 - x_1)) / v) +
                           abs(y_2 - e[last - e.begin()])));
      } else {
        r = min(r,
                (int)(abs(e.back() - y_1) + ceil((double)(abs(x_2 - x_1)) / v) +
                      abs(e.back() - y_2)));
      }
      next = upper_bound(e.begin(), e.end() + 1, y_2);
      last = next - 1;
      if (e[next - e.begin()] != 0) {
        r = min(r, (int)(abs(e[next - e.begin()] - y_1) +
                         ceil((double)(abs(x_2 - x_1)) / v) +
                         abs(e[next - e.begin()] - y_2)));
        if (e[last - e.begin()] != 0)
          r = min(r, (int)(abs(y_1 - e[last - e.begin()]) +
                           ceil((double)(abs(x_2 - x_1)) / v) +
                           abs(y_2 - e[last - e.begin()])));
      } else {
        r = min(r,
                (int)(abs(e.back() - y_1) + ceil((double)(abs(x_2 - x_1)) / v) +
                      abs(e.back() - y_2)));
      }
    }
    if (l.size() != 0) {
      next = upper_bound(l.begin(), l.end() + 1, y_1);
      last = next - 1;
      if (l[next - l.begin()] != 0) {
        r = min(r, (int)(abs(l[next - l.begin()] - y_1) + abs(x_2 - x_1) +
                         abs(l[next - l.begin()] - y_2)));
        if (l[last - l.begin()] != 0)
          r = min(r, (int)(abs(y_1 - l[last - l.begin()]) + abs(x_2 - x_1) +
                           abs(y_2 - l[last - l.begin()])));
      } else {
        r = min(r, (int)(abs(l.back() - y_1) + abs(x_2 - x_1) +
                         abs(l.back() - y_2)));
      }
      next = upper_bound(l.begin(), l.end() + 1, y_2);
      last = next - 1;
      if (l[next - l.begin()] != 0) {
        r = min(r, (int)(abs(l[next - l.begin()] - y_1) + abs(x_2 - x_1) +
                         abs(l[next - l.begin()] - y_2)));
        if (l[last - l.begin()] != 0)
          r = min(r, (int)(abs(y_1 - l[last - l.begin()]) + abs(x_2 - x_1) +
                           abs(y_2 - l[last - l.begin()])));
      } else {
        r = min(r, (int)(abs(l.back() - y_1) + abs(x_2 - x_1) +
                         abs(l.back() - y_2)));
      }
    }
    cout << r << endl;
  }
}
