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 maxn = 100000 + 10;
const int INF = 0x7fffffff;
int v[maxn];
int n, m, cl, ce, V, q;
void slove(int x1, int y1, int x2, int y2) {
  int ans = INF;
  int yy1 = min(y1, y2), yy2 = max(y1, y2);
  if (x1 > x2) {
    swap(x1, x2);
    swap(y1, y2);
  }
  int midl = -1, mide = -1, rl = -1, re = -1, ll = -1, le = -1;
  int elevator = (x2 - x1) / V;
  if ((x2 - x1) % V) elevator++;
  if (x1 == x2) {
    cout << abs(y1 - y2) << endl;
    return;
  }
  for (int i = yy1 + 1; i < yy2; i++)
    if (v[i] == 1) {
      midl = i;
      break;
    }
  for (int i = yy1 + 1; i < yy2; i++)
    if (v[i] == 2) {
      mide = i;
      break;
    }
  if (mide != -1) {
    cout << abs(y1 - y2) + elevator << endl;
    return;
  }
  if (midl != -1) {
    ans = min(ans, abs(y1 - y2) + x2 - x1);
  }
  for (int i = yy1 - 1; i >= 0; i--)
    if (v[i] == 1) {
      ll = i;
      break;
    }
  for (int i = yy1 - 1; i >= 0; i--)
    if (v[i] == 2) {
      le = i;
      break;
    }
  if (ll != -1) {
    ans = min(ans, abs(y1 - ll) + abs(ll - y2) + x2 - x1);
  }
  if (le != -1) {
    ans = min(ans, abs(y1 - le) + abs(le - y2) + elevator);
  }
  for (int i = yy2 + 1; i <= m; i--)
    if (v[i] == 1) {
      rl = i;
      break;
    }
  for (int i = yy2 + 1; i <= m; i--)
    if (v[i] == 2) {
      re = i;
      break;
    }
  if (rl != -1) {
    ans = min(ans, abs(y1 - rl) + abs(rl - y2) + x2 - x1);
  }
  if (re != -1) {
    ans = min(ans, abs(y1 - re) + abs(re - y2) + elevator);
  }
  cout << ans << endl;
  return;
}
int main() {
  cin >> n >> m >> cl >> ce >> V;
  int x, x1, x2, y1, y2;
  for (int i = 0; i < n + 5; i++) v[i] = 0;
  for (int i = 0; i < cl; i++) {
    cin >> x;
    v[x] = 1;
  }
  for (int i = 0; i < ce; i++) {
    cin >> x;
    v[x] = 2;
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    slove(x1, y1, x2, y2);
  }
  return 0;
}
