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;
struct Qe {
  long long l1, c1, l2, c2;
  bool operator<(const Qe& rhs) const { return c1 < rhs.c1; }
};
int32_t main() {
  long long n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  long long S[s];
  for (long long i = 0; i < s; i++) {
    cin >> S[i];
  }
  long long E[e];
  for (long long i = 0; i < e; i++) {
    cin >> E[i];
  }
  long long q;
  cin >> q;
  Qe Q[q];
  for (long long t = 0; t < q; t++) {
    cin >> Q[t].l1 >> Q[t].c1 >> Q[t].l2 >> Q[t].c2;
  }
  sort(Q, Q + q);
  long long js = 0;
  long long je = 0;
  for (long long i = 0; i < q; i++) {
    long long c1 = Q[i].c1;
    for (; js < s && S[js] < Q[i].c1; js++)
      ;
    for (; je < e && E[je] < Q[i].c1; je++)
      ;
    long long st = n + m + m;
    if (js) {
      st = min(st, abs(S[js - 1] - c1) + abs(Q[i].l1 - Q[i].l2) +
                       abs(S[js - 1] - Q[i].c2));
    }
    if (js < s) {
      st = min(st,
               abs(S[js] - c1) + abs(Q[i].l1 - Q[i].l2) + abs(S[js] - Q[i].c2));
    }
    if (Q[i].l1 == Q[i].l2) {
      st = min(st, abs(Q[i].c1 - Q[i].c2));
    }
    long long el = n + m + m;
    if (je) {
      el = min(el, abs(E[je - 1] - c1) + abs(Q[i].l1 - Q[i].l2) +
                       abs(E[je - 1] - Q[i].c2));
    }
    if (je < e) {
      el = min(el, abs(E[je] - c1) + (abs(Q[i].l1 - Q[i].l2) + v - 1) / v +
                       abs(E[je] - Q[i].c2));
    }
    if (Q[i].l1 == Q[i].l2) {
      el = min(el, abs(Q[i].c1 - Q[i].c2));
    }
    cout << min(st, el) << endl;
  }
}
