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 gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int cl, ce, v;
  cin >> cl >> ce >> v;
  vector<int> e(cl);
  for (int i = 0; i < cl; ++i) {
    cin >> e[i];
  }
  vector<int> l(ce);
  for (int i = 0; i < ce; ++i) {
    cin >> l[i];
  }
  int q;
  cin >> q;
  sort(l.begin(), l.end());
  sort(e.begin(), e.end());
  for (int i = 0; i < q; ++i) {
    int x1, x2, y1, y2;
    cin >> y1 >> x1 >> y2 >> x2;
    if (y1 == y2) {
      cout << abs(x2 - x1) << "\n";
    } else {
      int a, b, c, d;
      if (ce == 0) {
        a = 999999999;
        b = 999999999;
      } else {
        int left = -1;
        int right = l.size();
        while (left < right - 1) {
          int mid = (left + right) / 2;
          if (l[mid] <= x1) {
            left = mid;
          } else {
            right = mid;
          }
        }
        left = right - 1;
        a = l[max(0, left)];
        b = l[min(left + 1, ce - 1)];
      }
      if (cl == 0) {
        c = 999999999;
        d = 999999999;
      } else {
        int left = -1;
        int right = e.size();
        while (left < right - 1) {
          int mid = (left + right) / 2;
          if (e[mid] <= x1) {
            left = mid;
          } else {
            right = mid;
          }
        }
        left = right - 1;
        c = e[max(0, left)];
        d = e[min(left + 1, cl - 1)];
      }
      int height = abs(y2 - y1);
      int answer =
          (abs(x1 - a) + abs(x2 - a)) + height / v + (height % v != 0 ? 1 : 0);
      answer = min(answer, (abs(x1 - b) + abs(x2 - b)) + height / v +
                               (height % v != 0 ? 1 : 0));
      answer = min(answer, (abs(x1 - c) + abs(x2 - c)) + height);
      answer = min(answer, (abs(x1 - d) + abs(x2 - d)) + height);
      cout << answer << "\n";
    }
  }
  return 0;
}
