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() {
  std::ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, m, ns, ne, vel, x, inf = 1e18;
  cin >> n >> m >> ns >> ne >> vel;
  vector<long long> stair, ele;
  for (int i = int(1); i <= int(ns); i++) {
    cin >> x;
    stair.push_back(x);
  }
  for (int i = int(1); i <= int(ne); i++) {
    cin >> x;
    ele.push_back(x);
  }
  long long q;
  cin >> q;
  while (q--) {
    long long x1, x2, y1, y2, a, b, c, d, m1 = inf, m2 = inf, m3 = inf,
                                          m4 = inf;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y2 - y1) << "\n";
      continue;
    }
    a = lower_bound(stair.begin(), stair.end(), y1) - stair.begin();
    if (a != stair.size()) {
      m1 = abs(stair[a] - y1) + abs(stair[a] - y2);
    }
    b = upper_bound(stair.begin(), stair.end(), y1) - stair.begin() - 1;
    if (b != -1) {
      m2 = abs(stair[b] - y1) + abs(stair[b] - y2);
    }
    c = lower_bound(ele.begin(), ele.end(), y1) - ele.begin();
    if (c != ele.size()) {
      m3 = abs(ele[c] - y1) + abs(ele[c] - y2);
    }
    d = upper_bound(ele.begin(), ele.end(), y1) - ele.begin() - 1;
    if (d != -1) {
      m4 = abs(ele[d] - y1) + abs(ele[d] - y2);
    }
    cout << min(min(m1, m2) + abs(x2 - x1),
                min(m3, m4) + abs(x2 - x1) / vel + (abs(x2 - x1) % vel != 0))
         << "\n";
  }
}
