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>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
struct Timer {
  static map<string, Timer> ar;
  long long time;
  long long last;
  bool running;
  int count;
  Timer() : time(0), running(false), count(0) {}
  void start() {}
  void stop() {}
  static void start(string name) {}
  static void stop(string name) {}
  long double time_f() { return 0; }
  long double avg_time_f() { return 0; }
};
map<string, Timer> Timer::ar;
struct TimerRegion {
  string name;
  TimerRegion(string _name) : name(_name) { Timer::start(name); }
  ~TimerRegion() { Timer::stop(name); }
};
const int MAXN = (int)1e5 + 10;
bool inside(int x, int l, int r) { return l <= x && x < r; }
void solve() {
  TimerRegion timer_func(__FUNCTION__);
  ;
  int n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  static int ladders[MAXN];
  static int elevators[MAXN];
  for (int i = 0; i < cl; ++i) cin >> ladders[i];
  for (int i = 0; i < ce; ++i) cin >> elevators[i];
  sort(ladders, ladders + cl);
  sort(elevators, elevators + ce);
  int q;
  cin >> q;
  static int ladder_indices[2];
  static int elevator_indices[2];
  for (int i = 0; i < q; ++i) {
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    ladder_indices[0] = upper_bound(ladders, ladders + cl, c1) - ladders;
    ladder_indices[1] = ladder_indices[0] - 1;
    elevator_indices[0] =
        upper_bound(elevators, elevators + ce, c1) - elevators;
    elevator_indices[1] = elevator_indices[0] - 1;
    int res = (int)1e9;
    for (int j = 0; j < 2; ++j)
      if (inside(ladder_indices[j], 0, cl)) {
        int c = ladders[ladder_indices[j]];
        res = min(res, abs(c1 - c) + abs(r1 - r2) + abs(c - c2));
      }
    for (int j = 0; j < 2; ++j)
      if (inside(elevator_indices[j], 0, ce)) {
        int c = elevators[elevator_indices[j]];
        res = min(res, abs(c1 - c) + (abs(r1 - r2) + v - 1) / v + abs(c - c2));
      }
    if (r1 == r2) res = min(res, abs(c1 - c2));
    cout << res << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
