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;
void solve() {
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> stairs(cl);
  vector<long long> ele(ce);
  long long i;
  for (i = 0; i < cl; i++) cin >> stairs[i];
  for (i = 0; i < ce; i++) cin >> ele[i];
  sort(stairs.begin(), stairs.end());
  sort(ele.begin(), ele.end());
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (y1 > y2) swap(y1, y2);
    if (x1 == x2) {
      cout << (y2 - y1) << "\n";
      continue;
    }
    long long ans = 1e12;
    auto e1 = upper_bound(ele.begin(), ele.end(), y2);
    if (e1 != ele.begin()) {
      e1 = prev(e1);
      long long x = *e1;
      if (x >= y1 && x <= y2) {
        ans = min(ans, (long long)ceil(abs(x2 - x1) / double(v)) + (y2 - y1));
      } else {
        ans = min(ans, (long long)ceil(abs(x2 - x1) / double(v)) + (y1 - x) +
                           (y2 - x));
      }
    }
    auto e2 = lower_bound(ele.begin(), ele.end(), y1);
    if (e2 != ele.end()) {
      long long x = *e2;
      if (x >= y1 && x <= y2) {
        ans = min(ans, (long long)ceil(abs(x2 - x1) / double(v)) + (y2 - y1));
      } else {
        ans = min(ans, (long long)ceil(abs(x2 - x1) / double(v)) + (x - y1) +
                           (x - y2));
      }
    }
    auto s1 = upper_bound(stairs.begin(), stairs.end(), y2);
    if (s1 != stairs.begin()) {
      s1 = prev(s1);
      long long x = *s1;
      if (x >= y1 && x <= y2) {
        ans = min(ans, abs(x2 - x1) + (y2 - y1));
      } else {
        ans = min(ans, abs(x2 - x1) + (y1 - x) + (y2 - x));
      }
    }
    auto s2 = lower_bound(stairs.begin(), stairs.end(), y1);
    if (s2 != stairs.end()) {
      long long x = *s2;
      if (x >= y1 && x <= y2) {
        ans = min(ans, abs(x2 - x1) + (y2 - y1));
      } else {
        ans = min(ans, abs(x2 - x1) + (x - y1) + (x - y2));
      }
    }
    cout << ans << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
