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>
#pragma GCC optimize("03")
using namespace std;
int n, m, NL, NE, v, q, x, y, xx, yy;
int L[100100], E[100100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> m >> NL >> NE >> v;
  for (int i = 1; i <= NL; i++) cin >> L[i];
  for (int i = 1; i <= NE; i++) cin >> E[i];
  cin >> q;
  while (q--) {
    cin >> x >> y >> xx >> yy;
    int H = abs(x - xx);
    int bst = INT_MAX;
    int st, dr, mid;
    if (x == xx) {
      cout << abs(yy - y) << '\n';
      continue;
    }
    st = 1;
    dr = NE;
    while (st <= dr) {
      mid = st + dr >> 1;
      if (E[mid] >= y)
        dr = mid - 1;
      else
        st = mid + 1;
    }
    if (E[st] != 0)
      bst = min(bst, abs(E[st] - y) + (H - 1) / v + 1 + abs(E[st] - yy));
    if (E[st - 1] != 0)
      bst =
          min(bst, abs(E[st - 1] - y) + (H - 1) / v + 1 + abs(E[st - 1] - yy));
    st = 1;
    dr = NL;
    while (st <= dr) {
      mid = st + dr >> 1;
      if (L[mid] >= y)
        dr = mid - 1;
      else
        st = mid + 1;
    }
    if (L[st] != 0) bst = min(bst, abs(L[st] - y) + H + abs(L[st] - yy));
    if (L[st - 1] != 0)
      bst = min(bst, abs(L[st - 1] - y) + H + abs(L[st - 1] - yy));
    cout << bst << '\n';
  }
  return 0;
}
