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;
class Vec : public vector<int> {
 public:
  Vec(int n) {
    assign(n, 0);
    for (int i = 0; i < int(n); i++) cin >> operator[](i);
  }
  int getL(int a) {
    int i = upper_bound((*this).begin(), (*this).end(), a) - begin();
    return (*this)[max(i - 1, 0)];
  }
  int getR(int a) {
    int i = lower_bound((*this).begin(), (*this).end(), a) - begin();
    return (*this)[min(i, (int)size() - 1)];
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  Vec p(cl);
  Vec q(ce);
  auto getPDist = [&p](int x1, int y1, int x2, int y2) {
    if (p.empty()) return 1000000000;
    int l1 = p.getL(y1);
    int r1 = p.getR(y1);
    int l2 = p.getL(y2);
    int r2 = p.getR(y2);
    int t = abs(x1 - x2);
    int d = abs(y1 - l1) + abs(y2 - l1);
    d = min(d, abs(y1 - r1) + abs(y2 - r1));
    d = min(d, abs(y1 - l2) + abs(y2 - l2));
    d = min(d, abs(y1 - r2) + abs(y2 - r2));
    return d + t;
  };
  auto getEDist = [&q, v](int x1, int y1, int x2, int y2) {
    if (q.empty()) return 1000000000;
    int l1 = q.getL(y1);
    int r1 = q.getR(y1);
    int l2 = q.getL(y2);
    int r2 = q.getR(y2);
    int t = abs(x1 - x2);
    int d = abs(y1 - l1) + abs(y2 - l1);
    d = min(d, abs(y1 - r1) + abs(y2 - r1));
    d = min(d, abs(y1 - l2) + abs(y2 - l2));
    d = min(d, abs(y1 - r2) + abs(y2 - r2));
    return d + t / v + (t % v != 0);
  };
  int k;
  cin >> k;
  for (int i = 0; i < int(k); i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << min(getEDist(x1, y1, x2, y2), getPDist(x1, y1, x2, y2)) << endl;
  }
}
