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() {
  long long n, a, m, l, l1, c, c1, x1, x2, y1, y2, r1, r2, v;
  set<long long> sl;
  set<long long>::iterator itl;
  set<long long> sc;
  set<long long>::iterator itc;
  vector<pair<long long, long long> > vl;
  vector<pair<long long, long long> > vc;
  pair<long long, long long> p;
  cin >> n >> m >> l >> c >> v;
  for (int i = 1; i <= l; i++) {
    cin >> l1;
    sl.insert(l1);
  }
  for (int i = 1; i <= c; i++) {
    cin >> c1;
    sc.insert(c1);
  }
  cin >> a;
  for (int h = 1; h <= a; h++) {
    cin >> x1 >> y1 >> x2 >> y2;
    r1 = 200000001;
    r2 = 200000001;
    if (y1 > y2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    if (l != 0) {
      long long l;
      if (sl.upper_bound(y1) != sl.end()) {
        m = *sl.upper_bound(y1);
        l = abs(y1 - m) + abs(y2 - m) + abs(x1 - x2);
        r1 = min(r1, l);
      }
      if (sl.upper_bound(y1) != sl.begin()) {
        itl = sl.upper_bound(y1);
        itl--;
        m = *itl;
        l = abs(y1 - m) + abs(y2 - m) + abs(x1 - x2);
        r1 = min(r1, l);
      }
    }
    if (c != 0) {
      long long time = (abs(x1 - x2) + v - 1) / v;
      long long c;
      if (sc.upper_bound(y1) != sc.end()) {
        m = *sc.upper_bound(y1);
        c = (abs(m - y1) + abs(y2 - m) + time);
        r2 = min(r2, c);
      }
      if (sc.upper_bound(y1) != sc.begin()) {
        itc = sc.upper_bound(y1);
        itc--;
        m = *itc;
        c = (abs(m - y1) + abs(y2 - m) + time);
        r2 = min(r2, c);
      }
    }
    cout << min(r1, r2) << endl;
  }
  return 0;
}
