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;
long long n, m, l, e, v, q;
set<long long> alp, aep, alm, aem;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  alp.insert(999999999);
  alm.insert(999999999);
  aep.insert(999999999);
  aem.insert(999999999);
  cin >> n >> m >> l >> e >> v;
  for (int i = 0; i < l; i++) {
    long long h;
    cin >> h;
    aep.insert(h);
    aem.insert(-h);
  }
  for (int i = 0; i < e; i++) {
    long long h;
    cin >> h;
    alp.insert(h);
    alm.insert(-h);
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    long long x1, y1, x2, y2;
    cin >> y1 >> x1 >> y2 >> x2;
    if (y1 == y2) {
      cout << abs(x1 - x2) << "\n";
      continue;
    }
    if (x1 > x2) {
      swap(x1, x2);
    }
    auto lifl = alp.lower_bound(x1);
    auto lifr = alm.lower_bound(-x2);
    auto stupl = aep.lower_bound(x1);
    auto stupr = aem.lower_bound(-x2);
    long long first = min(abs(*lifl - x1) + abs(*lifl - x2),
                          abs(abs(*lifr) - x1) + abs(abs(*lifr) - x2));
    long long sec = min(abs(*stupl - x1) + abs(*stupl - x2),
                        abs(abs(*stupr) - x1) + abs(abs(*stupr) - x2));
    long long ans1 = abs(y1 - y2) / v;
    if (abs(y1 - y2) % v != 0) ans1++;
    long long ans2 = abs(y1 - y2);
    cout << min(ans1 + first, ans2 + sec) << "\n";
  }
  return 0;
}
