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>
#pragma GCC optimize("03")
using namespace std;
long long int const mod = 1000000007;
long long int solve(vector<long long int> &v2, long long int x1,
                    long long int y1, long long int x2, long long int y2,
                    long long int sz, long long int speed) {
  long long int id, ans = 1e16, sum, pos, diff;
  id = upper_bound(v2.begin(), v2.end(), y1) - v2.begin();
  if (id != sz) {
    pos = v2[id];
    sum = abs(pos - y1);
    diff = abs(x2 - x1);
    sum += (diff + speed - 1) / speed;
    sum += abs(y2 - pos);
    ans = min(ans, sum);
  }
  if (id != 0) {
    pos = v2[id - 1];
    sum = abs(pos - y1);
    diff = abs(x2 - x1);
    sum += (diff + speed - 1) / speed;
    sum += abs(y2 - pos);
    ans = min(ans, sum);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, st, el, v, ans, x, q, x1, y1, x2, y2;
  vector<long long int> v1, v2;
  cin >> n >> m >> st >> el >> v;
  for (long long int i = 0; i < st; i++) {
    cin >> x;
    v1.push_back(x);
  }
  for (long long int i = 0; i < el; i++) {
    cin >> x;
    v2.push_back(x);
  }
  cin >> q;
  while (q--) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    ans = solve(v2, x1, y1, x2, y2, el, v);
    ans = min(ans, solve(v1, x1, y1, x2, y2, st, 1));
    cout << ans << "\n";
  }
  return 0;
}
