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() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  int si[s], el[e];
  for (long long i = 0; i < s; i++) cin >> si[i];
  for (long long i = 0; i < e; i++) cin >> el[i];
  int q, x1, x2, y1, y2;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    int n_s, n_e, n_si, n_ei, t_e = 1e9, t_s = 1e9, p_s, p_e;
    if (s != 0) {
      n_si = lower_bound(si, si + s, y1) - si;
      if (n_si == 0)
        n_s = si[n_si] - y1, p_s = si[n_si];
      else if (n_si == s)
        n_s = y1 - si[n_si - 1], p_s = si[n_si - 1];
      else {
        n_s = min((y1 - si[n_si - 1]), (si[n_si] - y1));
        if ((y1 - si[n_si - 1]) < (si[n_si] - y1))
          p_s = si[n_si - 1];
        else
          p_s = si[n_si];
      }
      t_s = n_s + abs(x1 - x2) + abs(y2 - p_s);
    }
    if (e != 0) {
      n_ei = lower_bound(el, el + e, y1) - el;
      if (n_ei == 0)
        n_e = el[n_ei] - y1, p_e = el[n_ei];
      else if (n_ei == e)
        n_e = y1 - el[n_ei - 1], p_e = el[n_ei - 1];
      else {
        n_e = min((y1 - el[n_ei - 1]), (el[n_ei] - y1));
        if ((y1 - el[n_ei - 1]) < (el[n_ei] - y1))
          p_e = el[n_ei - 1];
        else
          p_e = el[n_ei];
      }
      t_e = n_e + ceil(abs(x1 - x2) / (1.0 * v)) + abs(p_e - y2);
    }
    cout << min(t_e, t_s) << endl;
  }
  return 0;
}
