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> s, e;
long long v;
long long calc(pair<long long, long long> x, pair<long long, long long> y) {
  long long ans = 1e15;
  auto its = lower_bound(s.begin(), s.end(), x.first);
  long long dy = abs(x.second - y.second);
  if (its != s.end()) {
    ans = min(ans, abs(*its - x.first) + dy + abs(*its - y.first));
  }
  if (its != s.begin()) {
    its = prev(its, 1);
    ans = min(ans, abs(*its - x.first) + dy + abs(*its - y.first));
  }
  auto ite = lower_bound(e.begin(), e.end(), x.first);
  if (ite != e.end()) {
    ans =
        min(ans, abs(*ite - x.first) + (dy + v - 1) / v + abs(*ite - y.first));
  }
  if (ite != e.begin()) {
    ite = prev(ite, 1);
    ans =
        min(ans, abs(*ite - x.first) + (dy + v - 1) / v + abs(*ite - y.first));
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, m, c1, c2;
  cin >> n >> m >> c1 >> c2 >> v;
  long long k;
  for (long long i = 0; i < c1; i++) {
    cin >> k;
    s.push_back(k);
  }
  for (long long i = 0; i < c2; i++) {
    cin >> k;
    e.push_back(k);
  }
  long long q;
  cin >> q;
  while (q--) {
    pair<long long, long long> x, y;
    cin >> x.second >> x.first >> y.second >> y.first;
    if (x.first > y.first) swap(x, y);
    cout << calc(x, y) << '\n';
  }
  return 0;
}
