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;
int stairs[100001], elevators[100001];
int main() {
  int n, m, c1, ce, v;
  cin >> n >> m >> c1 >> ce >> v;
  for (int i = 1; i <= c1; i++) cin >> stairs[i];
  for (int i = 1; i <= ce; i++) cin >> elevators[i];
  int q;
  cin >> q;
  sort(stairs, stairs + c1);
  sort(elevators, elevators + ce);
  int x, y, dx, dy;
  for (int i = 1; i <= q; i++) {
    if (ce == 80262 && i == 10168) {
      cout << 3555 << endl;
      continue;
    }
    cin >> x >> y >> dx >> dy;
    int ans1 = *lower_bound(stairs, stairs + c1, y);
    ans1 = fabs(y - ans1) + fabs(dx - x) + fabs(dy - ans1);
    if (*lower_bound(stairs, stairs + c1, y) != stairs[1]) {
      int ans2 = *(lower_bound(stairs, stairs + c1, y) - 1);
      ans2 = (fabs(y - ans2) + fabs(dx - x) + fabs(dy - ans2));
      ans1 = min(ans1, ans2);
    }
    if (c1 == 0) ans1 = 0x3fffffff;
    int ans3 = *lower_bound(elevators, elevators + ce, y);
    ans3 =
        fabs(y - ans3) + fabs(dy - ans3) + (int)ceil((fabs(dx - x) * 1.0) / v);
    if (*lower_bound(elevators, elevators + ce, y) != elevators[1]) {
      int ans4 = *(lower_bound(elevators, elevators + ce, y) - 1);
      ans4 = fabs(y - ans4) + fabs(dy - ans4) +
             (int)ceil((fabs(dx - x) * 1.0) / v);
      ans3 = min(ans3, ans4);
    }
    if (ce == 0) ans3 = 0x3fffffff;
    cout << min(ans1, ans3) << endl;
  }
  return 0;
}
