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(int argc, char** argv) {
  int n, m, cl, ce, v, x1, x2, y1, y2;
  scanf("%d %d %d %d %d", &n, &m, &cl, &ce, &v);
  vector<int> l(cl), e(ce);
  for (int i = 0; i < static_cast<int>(cl); ++i) {
    scanf("%d", &l[i]);
  }
  for (int i = 0; i < static_cast<int>(ce); ++i) {
    scanf("%d", &e[i]);
  }
  sort(l.begin(), l.end());
  sort(e.begin(), e.end());
  int q;
  scanf("%d", &q);
  for (int Q = 0; Q < static_cast<int>(q); ++Q) {
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    int ans = 1e9;
    if (x1 == x2) {
      ans = ((y2 - y1) > 0 ? (y2 - y1) : -(y2 - y1));
    }
    if (cl) {
      vector<int> cand;
      auto it = lower_bound(l.begin(), l.end(), y1);
      if (it != l.begin()) {
        --it;
        cand.push_back(*it);
        ++it;
      }
      if (it != l.end()) {
        cand.push_back(*it);
        ++it;
        if (it != l.end()) {
          cand.push_back(*it);
        }
      }
      it = lower_bound(l.begin(), l.end(), y2);
      if (it != l.end()) {
        cand.push_back(*it);
        ++it;
        if (it != l.end()) {
          cand.push_back(*it);
        }
      }
      cand.push_back(*l.begin());
      cand.push_back(*l.rbegin());
      for (int i = 0; i < static_cast<int>(cand.size()); ++i) {
        ans = min(ans,
                  ((x1 - x2) > 0 ? (x1 - x2) : -(x1 - x2)) +
                      ((cand[i] - y1) > 0 ? (cand[i] - y1) : -(cand[i] - y1)) +
                      ((cand[i] - y2) > 0 ? (cand[i] - y2) : -(cand[i] - y2)));
      }
    }
    if (ce) {
      vector<int> cand;
      auto it = lower_bound(e.begin(), e.end(), y1);
      if (it != e.begin()) {
        --it;
        cand.push_back(*it);
        ++it;
      }
      if (it != e.end()) {
        cand.push_back(*it);
        ++it;
        if (it != e.end()) {
          cand.push_back(*it);
        }
      }
      it = lower_bound(e.begin(), e.end(), y2);
      if (it != e.end()) {
        cand.push_back(*it);
        ++it;
        if (it != e.end()) {
          cand.push_back(*it);
        }
      }
      cand.push_back(*e.begin());
      cand.push_back(*e.rbegin());
      for (int i = 0; i < static_cast<int>(cand.size()); ++i) {
        ans = min(ans,
                  (((x1 - x2) > 0 ? (x1 - x2) : -(x1 - x2)) + v - 1) / v +
                      ((cand[i] - y1) > 0 ? (cand[i] - y1) : -(cand[i] - y1)) +
                      ((cand[i] - y2) > 0 ? (cand[i] - y2) : -(cand[i] - y2)));
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
