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;
vector<int> l;
vector<int> e;
int v;
int res = 1e9;
int i1, rtfgyuhjik, i2, j2;
void updl(int x) {
  int u = abs(rtfgyuhjik - x) + abs(j2 - x) + abs(i2 - i1);
  res = min(res, u);
}
void upde(int x) {
  int t = abs(i2 - i1);
  t = (t + v - 1) / v;
  int u = abs(rtfgyuhjik - x) + abs(j2 - x) + t;
  res = min(res, u);
}
signed main() {
  int n, m, cl, ce;
  scanf("%d %d %d %d %d", &n, &m, &cl, &ce, &v);
  while (cl--) {
    int x;
    scanf("%d", &x);
    l.push_back(x);
  }
  while (ce--) {
    int x;
    scanf("%d", &x);
    e.push_back(x);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    res = 1e9;
    scanf("%d %d %d %d", &i1, &rtfgyuhjik, &i2, &j2);
    if (l.size()) {
      auto it = upper_bound(l.begin(), l.end(), rtfgyuhjik);
      if (it != l.end()) updl(*it);
      if (it != l.begin()) {
        --it;
        updl(*it);
      }
      it = upper_bound(l.begin(), l.end(), j2);
      if (it != l.end()) updl(*it);
      if (it != l.begin()) {
        --it;
        updl(*it);
      }
    }
    if (e.size()) {
      auto it = upper_bound(e.begin(), e.end(), rtfgyuhjik);
      if (it != e.end()) upde(*it);
      if (it != e.begin()) {
        --it;
        upde(*it);
      }
      it = upper_bound(e.begin(), e.end(), j2);
      if (it != e.end()) upde(*it);
      if (it != e.begin()) {
        --it;
        upde(*it);
      }
    }
    cout << res << endl;
  }
  return 0;
}
