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 int intMAX = 2147483647;
const long long int llMAX = 9223372036854775807;
const vector<pair<int, int>> cardinalP = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
long long POW(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  return a * POW(a, b - 1);
}
map<tuple<int, int, int, int>, long long> myM;
int n, m, c, d, v;
vector<int> s, e;
long long int dist(long long int sx, long long int sy, long long int ex,
                   long long int ey) {
  if (myM.count({sx, sy, ex, ey})) {
    return myM[{sx, sy, ex, ey}];
  }
  if (sx == ex) {
    myM[{sx, sy, ex, ey}] = abs(sy - ey);
    myM[{ex, ey, sx, sy}] = abs(sy - ey);
    return abs(sy - ey);
  }
  long long sMin = 92233720368545807;
  long long eMin = 92233720368545807;
  auto it = lower_bound(s.begin(), s.end(), sy);
  if (c >= 1) {
    if (it == s.end()) {
      it--;
      sMin = min(sMin, abs(*it - ey) + abs(*it - sy) + abs(sx - ex));
    } else if (it == s.begin()) {
      sMin = min(sMin, abs(*it - ey) + abs(*it - sy) + abs(sx - ex));
    } else {
      sMin = min(sMin, abs(*it - ey) + abs(*it - sy) + abs(sx - ex));
      it--;
      sMin = min(sMin, abs(*it - ey) + abs(*it - sy) + abs(sx - ex));
    }
  }
  it = lower_bound(e.begin(), e.end(), sy);
  if (d >= 1) {
    if (it == e.end()) {
      it--;
      eMin =
          min(eMin, abs(*it - ey) + abs(*it - sy) + (abs(sx - ex) + v - 1) / v);
    } else if (it == e.begin()) {
      eMin =
          min(eMin, abs(*it - ey) + abs(*it - sy) + (abs(sx - ex) + v - 1) / v);
    } else {
      eMin =
          min(eMin, abs(*it - ey) + abs(*it - sy) + (abs(sx - ex) + v - 1) / v);
      it--;
      eMin =
          min(eMin, abs(*it - ey) + abs(*it - sy) + (abs(sx - ex) + v - 1) / v);
    }
  }
  long long ans = min(sMin, eMin);
  myM[{sx, sy, ex, ey}] = ans;
  myM[{ex, ey, sx, sy}] = ans;
  return ans;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> c >> d >> v;
  s.resize(c);
  e.resize(d);
  for (int i = 0; i < c; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < d; i++) {
    cin >> e[i];
  }
  int q;
  cin >> q;
  vector<vector<int>> ar(q, vector<int>(4));
  for (int i = 0; i < q; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> ar[i][j];
    }
  }
  for (int i = 0; i < q; i++) {
    cout << dist(ar[i][0], ar[i][1], ar[i][2], ar[i][3]) << '\n';
  }
  return 0;
}
