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 x, y, xx, yy, q, v, n, m, lif, l;
vector<int> vlift, vl;
long long f_lift(int x, int y, int xx, int yy) {
  if (vlift.size() == 0) return 2e+9;
  int l = 0;
  int r = vlift.size() - 1;
  while (l < r) {
    int c = (l + r) / 2;
    if (vlift[c] < y)
      l = c + 1;
    else
      r = c;
  }
  int ans = 2e+9;
  if (l < vlift.size()) {
    ans = min(ans, abs(y - vlift[l]) + abs(yy - vlift[l]) +
                       (abs(x - xx) + v - 1) / v);
  }
  if (l - 1 >= 0) {
    ans = min(ans, abs(y - vlift[l - 1]) + abs(yy - vlift[l - 1]) +
                       (abs(x - xx) + v - 1) / v);
  }
  return ans;
}
long long f_l(int x, int y, int xx, int yy) {
  if (vl.size() == 0) return 2e+9;
  int l = 0;
  int r = vl.size() - 1;
  while (l < r) {
    int c = (l + r) / 2;
    if (vl[c] < y)
      l = c + 1;
    else
      r = c;
  }
  int ans = 2e+9;
  if (l < vl.size()) {
    ans = min(ans, abs(y - vl[l]) + abs(yy - vl[l]) + (abs(x - xx)));
  }
  if (l - 1 >= 0) {
    ans = min(ans, abs(y - vl[l - 1]) + abs(yy - vl[l - 1]) + (abs(x - xx)));
  }
  return ans;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> n >> m >> l >> lif >> v;
  for (int i = 0; i < l; ++i) {
    int x;
    cin >> x;
    vl.push_back(x);
  }
  for (int i = 0; i < lif; ++i) {
    int x;
    cin >> x;
    vlift.push_back(x);
  }
  sort(vl.begin(), vl.end());
  sort(vlift.begin(), vlift.end());
  cin >> q;
  for (int i = 0; i < q; ++i) {
    cin >> x >> y >> xx >> yy;
    if (x != xx) {
      cout << min(f_lift(x, y, xx, yy), f_l(x, y, xx, yy)) << endl;
    } else {
      cout << abs(yy - y) << endl;
    }
  }
  return 0;
}
