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 main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n, m, s, l, lv;
  cin >> n >> m >> s >> l >> lv;
  vector<long long> stairs(s);
  vector<long long> lyfts(l);
  for (long long i = 0; i < s; ++i) cin >> stairs[i];
  for (long long i = 0; i < l; ++i) cin >> lyfts[i];
  long long q;
  cin >> q;
  for (long long k = 0; k < q; ++k) {
    long long h1, pos1, h2, pos2, ans;
    cin >> h1 >> pos1 >> h2 >> pos2;
    if (h1 == h2)
      ans = abs(pos1 - pos2);
    else {
      long long l_b_s = 0, l_b_l = 0, tl = 1e15, ts = 1e15;
      if (lyfts.size() != 0) {
        auto l_b_ll = lower_bound(lyfts.begin(), lyfts.end(), pos2);
        if (l_b_ll == lyfts.end()) --l_b_ll;
        l_b_l = *l_b_ll;
        tl = abs(l_b_l - pos1) + abs(l_b_l - pos2);
        double lyftime = abs(double(h1) - double(h2)) / lv;
        if (lyftime > abs(h1 - h2) / lv)
          tl += (long long)++lyftime;
        else
          tl += (long long)lyftime;
      }
      if (stairs.size() != 0) {
        auto l_b_ss = lower_bound(stairs.begin(), stairs.end(), pos2);
        if (l_b_ss == stairs.end()) --l_b_ss;
        l_b_s = *l_b_ss;
        ts = abs(l_b_s - pos1) + abs(l_b_s - pos2) + abs(h1 - h2);
      }
      ans = min(tl, ts);
    }
    cout << ans << endl;
  }
  return 0;
}
