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 MOD = 1000000007;
long double PI = 4 * atan(1);
long long n, m, c1, c2, v, l, t, p, q, r, second, Min, cur, ans;
vector<long long> v1, v2;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m >> c1 >> c2 >> v;
  for (int i = 0; i < c1; i++) {
    cin >> l;
    v1.push_back(l);
  }
  for (int i = 0; i < c2; i++) {
    cin >> l;
    v2.push_back(l);
  }
  v1.push_back(0), v2.push_back(0);
  v1.push_back(MOD), v2.push_back(MOD);
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  cin >> t;
  while (t--) {
    cin >> p >> q >> r >> second;
    if (q > second) {
      swap(q, second);
      swap(p, r);
    }
    Min = MOD;
    ans = MOD;
    int i = lower_bound(v1.begin(), v1.end(), q) - v1.begin();
    if (v1[i] >= q && v1[i] <= second) {
      cur = abs(r - p) + abs(second - q);
    } else {
      if (v1[i - 1] != 0) Min = min(Min, q - v1[i - 1]);
      if (v1[i] != MOD) Min = min(Min, v1[i] - second);
      cur = 2LL * Min + abs(r - p) + abs(second - q);
    }
    ans = min(ans, cur);
    Min = MOD;
    i = lower_bound(v2.begin(), v2.end(), q) - v2.begin();
    if (v2[i] >= q && v2[i] <= second) {
      if (abs(r - p) % v == 0) {
        cur = abs(r - p) / v;
      } else {
        cur = (abs(r - p) / v) + 1;
      }
      cur += abs(second - q);
    } else {
      if (v2[i - 1] != 0) Min = min(Min, q - v2[i - 1]);
      if (v2[i] != MOD) Min = min(Min, v2[i] - second);
      if (abs(r - p) % v == 0) {
        cur = abs(r - p) / v;
      } else {
        cur = (abs(r - p) / v) + 1;
      }
      cur += (2LL * Min + abs(second - q));
    }
    ans = min(ans, cur);
    cout << ans << "\n";
  }
  return 0;
}
