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;
const long long INF = 1e9 + 7;
const int N = 1e5 + 10;
int solve(int x1, int y1, int x2, int y2, int y, int v) {
  return abs(y1 - y) + abs(y2 - y) + (abs(x2 - x1) - 1 + v) / v;
}
int main() {
  int n, m, k1, k2, v;
  cin >> n >> m >> k1 >> k2 >> v;
  vector<int> v1, v2;
  v1.push_back(-5e8);
  v2.push_back(-5e8);
  for (int i = 1; i <= k1; i++) {
    int x;
    cin >> x;
    v1.push_back(x);
  }
  for (int i = 1; i <= k2; i++) {
    int x;
    cin >> x;
    v2.push_back(x);
  }
  v1.push_back(5e8);
  v2.push_back(5e8);
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << '\n';
      continue;
    }
    int o1 = lower_bound(v1.begin(), v1.end(), x1) - v1.begin();
    int o2 = lower_bound(v2.begin(), v2.end(), x1) - v2.begin();
    int ans1 = min(solve(x1, y1, x2, y2, v1[o1], 1),
                   solve(x1, y1, x2, y2, v1[o1 - 1], 1));
    int ans2 = min(solve(x1, y1, x2, y2, v2[o2], v),
                   solve(x1, y1, x2, y2, v2[o2 - 1], v));
    cout << min(ans1, ans2) << '\n';
  }
  return 0;
}
