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> cl, el;
long long n, m, c, ce, v, q, x1, x2, yl, y2, ans, x;
long long ub(vector<long long> v, int target) {
  int mid, ans = -1, l = 0, r = v.size();
  while (l <= r) {
    mid = (l + r) / 2;
    if (v[mid] >= target) {
      ans = v[mid];
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
long long lb(vector<long long> v, int target) {
  int mid, ans = -1, l = 0, r = v.size() - 1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (v[mid] <= target) {
      ans = v[mid];
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> c >> ce >> v;
  for (int i = 1; i <= c; i++) {
    cin >> x;
    cl.push_back(x);
  }
  for (int i = 1; i <= ce; i++) {
    cin >> x;
    el.push_back(x);
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> yl >> x2 >> y2;
    if (x1 > x2) {
      swap(x1, x2);
      swap(yl, y2);
    }
    ans = LLONG_MAX;
    long long cmp = ub(el, min(yl, y2));
    if (cmp <= max(yl, y2)) {
      ans = (long long)ceil(abs(x1 - x2) * 1.0 / v) + abs(yl - y2);
    } else {
      long long lower = lb(el, min(yl, y2));
      long long upper = ub(el, max(yl, y2));
      if (lower > 0)
        ans =
            min(ans, abs(lower - yl) + (long long)ceil(abs(x1 - x2) * 1.0 / v) +
                         abs(lower - y2));
      if (upper > 0)
        ans =
            min(ans, abs(upper - yl) + (long long)ceil(abs(x1 - x2) * 1.0 / v) +
                         abs(upper - y2));
    }
    cmp = ub(cl, max(yl, y2));
    if (cmp >= min(yl, y2)) {
      ans = min(ans, abs(x1 - x2) + abs(yl - y2));
    } else {
      long long lower = lb(cl, min(yl, y2));
      long long upper = ub(cl, max(yl, y2));
      if (lower > 0)
        ans = min(ans, abs(lower - yl) + abs(x1 - x2) + abs(lower - y2));
      if (upper > 0)
        ans = min(ans, abs(upper - yl) + abs(x1 - x2) + abs(upper - y2));
    }
    cout << ans << "\n";
  }
}
