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;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(nullptr);
  cin.tie(nullptr);
  solve();
}
const int MAXN = 100100;
int n, m;
int q;
int n1, n2;
int v;
int p1[MAXN], p2[MAXN];
inline int check(int xs, int ys, int xf, int yf, int pos, int v) {
  int res = 1e+9;
  res = abs(pos - ys) + abs(pos - yf);
  int hor = (abs(xs - xf)) / v;
  if (abs(xs - xf) % v != 0) {
    hor++;
  }
  res += hor;
  return res;
}
void solve() {
  cin >> n >> m >> n1 >> n2 >> v;
  for (int i = 0; i < n1; i++) {
    cin >> p1[i];
  }
  for (int i = 0; i < n2; i++) {
    cin >> p2[i];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    int xs, ys, xf, yf;
    cin >> xs >> ys >> xf >> yf;
    int res = 1e+9;
    {
      int idx = lower_bound(p1, p1 + n1, xs) - p1;
      if (idx != n1) {
        res = min(res, check(xs, ys, xf, yf, p1[idx], 1));
      }
      if (idx != 0) {
        res = min(res, check(xs, ys, xf, yf, p1[idx - 1], 1));
      }
    }
    {
      int idx = lower_bound(p2, p2 + n2, xs) - p2;
      if (idx != n2) {
        res = min(res, check(xs, ys, xf, yf, p2[idx], v));
      }
      if (idx != 0) {
        res = min(res, check(xs, ys, xf, yf, p2[idx - 1], v));
      }
    }
    cout << res << endl;
  }
}
