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;
const int N = 1e5 + 7;
const long long inf = 1e18 + 7;
vector<int> ls;
vector<int> lf;
int main() {
  int n, m, lest, lift, mx;
  cin >> n >> m >> lest >> lift >> mx;
  for (int i = 1; i <= lest; i++) {
    int a;
    scanf("%d", &a);
    ls.push_back(a);
  }
  for (int i = 1; i <= lift; i++) {
    int a;
    scanf("%d", &a);
    lf.push_back(a);
  }
  int q;
  cin >> q;
  while (q--) {
    int a, b, aa, bb;
    long long ans = inf;
    scanf("%d%d%d%d", &a, &b, &aa, &bb);
    if (a == aa) {
      cout << abs(b - bb) << endl;
      continue;
    }
    int lesl, lesr, lifl, lifr;
    lesl = upper_bound(ls.begin(), ls.end(), bb) - ls.begin();
    lesr = upper_bound(ls.begin(), ls.end(), bb) - ls.begin() + 1;
    lifl = upper_bound(lf.begin(), lf.end(), bb) - lf.begin();
    lifr = upper_bound(lf.begin(), lf.end(), bb) - lf.begin() + 1;
    lesl--, lesr--, lifl--, lifr--;
    if (ls.size() > 0) {
      if (ls[lesl] <= bb && lesl != -1)
        ans = min(ans,
                  1LL * abs(a - aa) + abs(ls[lesl] - b) + abs(ls[lesl] - bb));
      if (lesr < ls.size()) {
        ans = min(ans,
                  1LL * abs(b - ls[lesr]) + abs(aa - a) + abs(ls[lesr] - bb));
      }
    }
    if (lf.size() > 0) {
      if (lf[lifl] <= bb && lifl != -1)
        ans = min(ans, 1LL * int(ceil(abs(aa - a) / (mx * 1.0)) +
                                 abs(lf[lifl] - b) + abs(bb - lf[lifl])));
      if (lifr < lf.size()) {
        ans = min(ans,
                  1LL * int(abs(b - lf[lifr]) + ceil(abs(aa - a) / (mx * 1.0)) +
                            abs(lf[lifr] - bb)));
      }
    }
    cout << ans << endl;
  }
}
