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 OO = 1e17;
const long long mod = 1e9 + 7;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long n, m, sta, eve, v, q;
vector<long long> a, b;
int main() {
  fast();
  cin >> n >> m >> sta >> eve >> v;
  int tt;
  for (int i = 0; i < sta; i++) {
    cin >> tt;
    a.push_back(tt);
  }
  for (int i = 0; i < eve; i++) {
    cin >> tt;
    b.push_back(tt);
  }
  cin >> q;
  long long x, y, xx, yy;
  for (int i = 0; i < q; i++) {
    cin >> x >> y >> xx >> yy;
    if (x == xx) {
      cout << abs(y - yy) << endl;
      continue;
    }
    long long res = OO, res2 = OO;
    ;
    if (sta > 0) {
      long long it = lower_bound(a.begin(), a.end(), y) - a.begin();
      if (it < sta)
        res = min(res, abs(y - a[it]) + abs(x - xx) + abs(yy - a[it]));
      if (it > 0)
        res = min(res, abs(y - a[it - 1]) + abs(x - xx) + abs(yy - a[it - 1]));
    }
    if (eve > 0) {
      long long it = lower_bound(b.begin(), b.end(), y) - b.begin();
      if (it < eve)
        res = min(res, abs(y - b[it]) + abs(x - xx) / v +
                           (abs(x - xx) % v > 0) + abs(yy - b[it]));
      if (it > 0)
        res = min(res, abs(y - b[it - 1]) + abs(x - xx) +
                           (abs(x - xx) % v > 0) + abs(yy - b[it - 1]));
    }
    cout << res << endl;
  }
  return 0;
}
