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 desperate_optimization(int precision) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
int stairs[100000 + 5];
int elev[100000 + 5];
int n, m, cs, ce, v;
int y11, x11, y2, x2;
int lowerstairs(int xs) {
  int lo = 0;
  int hi = cs - 1;
  int ans = -5e8;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (stairs[mid] <= xs) {
      ans = stairs[mid];
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  return ans;
}
int upperstairs(int xs) {
  int lo = 0;
  int hi = cs - 1;
  int ans = -5e8;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (stairs[mid] > xs) {
      ans = stairs[mid];
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  return ans;
}
int lowerelev() {
  int lo = 0;
  int hi = ce - 1;
  int ans = -1;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (elev[mid] <= x11) {
      ans = elev[mid];
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  if (ans == -1) return 5e8;
  return abs(x2 - ans) + abs(ans - x11) + (abs(y2 - y11) + v - 1) / v;
}
int upperelev() {
  int lo = 0;
  int hi = ce - 1;
  int ans = -1;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (elev[mid] > x11) {
      ans = elev[mid];
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  if (ans == -1) return 5e8;
  return abs(x2 - ans) + abs(ans - x11) + (abs(y2 - y11) + v - 1) / v;
}
int main() {
  desperate_optimization(10);
  clock_t CLOCK;
  CLOCK = clock();
  cin >> n >> m >> cs >> ce >> v;
  for (int i = 0; i < cs; i++) cin >> stairs[i];
  for (int i = 0; i < ce; i++) cin >> elev[i];
  int q;
  cin >> q;
  while (q--) {
    cin >> y11 >> x11 >> y2 >> x2;
    int ans = 2e9;
    ans = min(ans, abs(x11 - lowerstairs(x11)) + abs(x2 - lowerstairs(x11)) +
                       abs(y2 - y11));
    ans = min(ans, abs(x11 - upperstairs(x11)) + abs(x2 - upperstairs(x11)) +
                       abs(y2 - y11));
    ans = min(ans, lowerelev());
    ans = min(ans, upperelev());
    cout << ans << '\n';
  }
  cerr << "PROCESSED TIME " << (clock() - CLOCK) * 1.0 / (1.0 * CLOCKS_PER_SEC)
       << '\n';
  return 0;
}
