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 main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<int> stairs(cl, 0);
  for (int i = 0; i < cl; ++i) cin >> stairs[i];
  vector<int> elevator(ce, 0);
  for (int i = 0; i < ce; ++i) cin >> elevator[i];
  long double x1, y1, x2, y2;
  int q;
  cin >> q;
  int ind;
  long double ans;
  for (int i = 0; i < q; ++i) {
    cin >> y1 >> x1 >> y2 >> x2;
    ans = INT_MAX;
    auto i_low = lower_bound(stairs.begin(), stairs.end(), x1);
    if (i_low != stairs.end()) {
      ind = distance(stairs.begin(), i_low);
      ans = min(ans,
                abs(y1 - y2) + abs(x1 - stairs[ind]) + abs(stairs[ind] - x2));
    }
    if (i_low != stairs.begin()) {
      --i_low;
      ind = distance(stairs.begin(), i_low);
      ans = min(ans,
                abs(y1 - y2) + abs(x1 - stairs[ind]) + abs(stairs[ind] - x2));
    }
    i_low = lower_bound(elevator.begin(), elevator.end(), x1);
    if (i_low != elevator.end()) {
      ind = distance(elevator.begin(), i_low);
      ans = min(ans, ceil(abs(y1 - y2) / v) + abs(x1 - elevator[ind]) +
                         abs(elevator[ind] - x2));
    }
    if (i_low != elevator.begin()) {
      --i_low;
      ind = distance(elevator.begin(), i_low);
      ans = min(ans, ceil(abs(y1 - y2) / v) + abs(x1 - elevator[ind]) +
                         abs(elevator[ind] - x2));
    }
    cout << fixed << setprecision(0) << ans << endl;
  }
  return 0;
}
