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 MAXN = 200002;
struct Node {
  vector<Node *> outcome;
  bool visited;
  long long value;
  int comp;
};
long long n, m, cl, cc, v;
vector<long long> ladders(MAXN);
vector<long long> elevators(MAXN);
long long upper(int n) {
  if (n % v == 0) return n / v;
  return n / v + 1;
}
int main() {
  cin >> n >> m >> cl >> cc >> v;
  for (int i = 0; i < cl; i++) {
    cin >> ladders[i];
  }
  for (int i = 0; i < cc; i++) {
    cin >> elevators[i];
  }
  sort(ladders.begin(), ladders.begin() + cl);
  sort(elevators.begin(), elevators.begin() + cc);
  int q;
  cin >> q;
  for (int j = 0; j < q; j++) {
    int x1, y1, x2, y2;
    cin >> y1 >> x1 >> y2 >> x2;
    long long current_answer = numeric_limits<long long>::max();
    if (y1 == y2) current_answer = abs(x1 - x2);
    long long left_ladder = -1;
    long long right_ladder = cl;
    while (right_ladder - left_ladder > 1) {
      auto mid = (right_ladder + left_ladder) >> 1;
      if (ladders[mid] > x1) {
        right_ladder = mid;
      } else {
        left_ladder = mid;
      }
    }
    long long left_elevator = -1;
    long long right_elevator = cc;
    while (right_elevator - left_elevator > 1) {
      auto mid = (right_elevator + left_elevator) >> 1;
      if (elevators[mid] > x1) {
        right_elevator = mid;
      } else {
        left_elevator = mid;
      }
    }
    if (left_ladder != -1)
      current_answer =
          min(current_answer, abs(y1 - y2) + abs(ladders[left_ladder] - x2) +
                                  abs(ladders[left_ladder] - x1));
    if (right_ladder != cl)
      current_answer =
          min(current_answer, abs(y1 - y2) + abs(ladders[right_ladder] - x2) +
                                  abs(ladders[right_ladder] - x1));
    if (left_elevator != -1)
      current_answer =
          min(current_answer, upper(abs(y1 - y2)) +
                                  abs(elevators[left_elevator] - x2) +
                                  abs(elevators[left_elevator] - x1));
    if (right_elevator != cc)
      current_answer =
          min(current_answer, upper(abs(y1 - y2)) +
                                  abs(elevators[right_elevator] - x2) +
                                  abs(elevators[right_elevator] - x1));
    cout << current_answer << "\n";
  }
  return 0;
}
