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 N = 1e5 + 5;
int n, k, flag = 0;
int A[N], B[N];
vector<int> v1, v2;
int v;
int stairl(int a) {
  int p = upper_bound(v1.begin(), v1.end(), a) - v1.begin() - 1;
  return v1[p];
}
int stairr(int a) {
  int q = lower_bound(v1.begin(), v1.end(), a) - v1.begin();
  return v1[q];
}
int liftl(int a) {
  int p = upper_bound(v2.begin(), v2.end(), a) - v2.begin() - 1;
  return v2[p];
}
int liftr(int a) {
  int q = lower_bound(v2.begin(), v2.end(), a) - v2.begin();
  return v2[q];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int i, j, first, second = 0, ans = 0, a, b, m, z, x1, x2, y1, y2;
  cin >> n >> m >> a >> b >> v;
  v1.assign(a, 0);
  v2.assign(b, 0);
  for (i = 0; i < a; i++) cin >> v1[i];
  for (i = 0; i < b; i++) cin >> v2[i];
  cin >> k;
  while (k--) {
    cin >> y1 >> x1 >> y2 >> x2;
    ans = 1000000007;
    if (a > 0) {
      z = stairr(x1);
      ans = min(ans, abs(z - x1) + abs(y2 - y1) + abs(z - x2));
      z = stairl(x1);
      ans = min(ans, abs(z - x1) + abs(y2 - y1) + abs(z - x2));
    }
    if (b > 0) {
      z = liftl(x1);
      ans = min(ans, abs(z - x1) + abs(y2 - y1) / v +
                         ((abs(y2 - y1) % v) != 0) + +abs(z - x2));
      z = liftr(x1);
      ans = min(ans, abs(z - x1) + abs(y2 - y1) / v +
                         ((abs(y2 - y1) % v) != 0) + +abs(z - x2));
    }
    cout << ans << "\n";
  }
}
