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;
#pragma GCC optimize("-O2")
int n, m, cl, ce, v, q, x1, x2, ya, y2, ans1, ans2;
int S[(int)1e5], E[(int)1e5];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < ce; i++) {
    cin >> E[i];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> ans1 >> x2 >> ans2;
    ya = min(ans1, ans2);
    y2 = max(ans1, ans2);
    int t1, t2;
    t1 = lower_bound(S, S + cl, ya) - S;
    t2 = lower_bound(E, E + ce, ya) - E;
    if (t1 < cl) {
      if (S[t1] > y2) {
        ans1 = 2 * (S[t1] - y2);
        if (t1 > 0) {
          ans1 = min(ans1, 2 * (ya - S[t1 - 1]));
        }
      } else
        ans1 = 0;
    } else
      ans1 = 2 * (ya - S[cl - 1]);
    if (t2 < ce) {
      if (E[t2] > y2) {
        ans2 = 2 * (E[t2] - y2);
        if (t2 > 0) {
          ans2 = min(ans2, 2 * (ya - E[t2 - 1]));
        }
      } else
        ans2 = 0;
    } else
      ans2 = 2 * (ya - E[ce - 1]);
    if (cl == 0) ans1 = (int)1e9;
    if (ce == 0) ans2 = (int)1e9;
    x2 = abs(x2 - x1);
    if (x2 == 0) {
      cout << y2 - ya << "\n";
      continue;
    }
    ans1 = ans1 + x2 + y2 - ya;
    if (x2 % v == 0)
      ans2 = ans2 + y2 - ya + x2 / v;
    else
      ans2 = ans2 + y2 - ya + x2 / v + 1;
    cout << min(ans1, ans2) << "\n";
  }
  return 0;
}
