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 get(int x1, int y1, int x2, int y2, vector<int>& st, int v) {
  int ans = 2e9;
  int pos = upper_bound(st.begin(), st.end(), y2) - st.begin();
  pos--;
  for (int i = 0; i < 3; i++) {
    if (pos >= 0 && pos < (st.size())) {
      if (st[pos] <= y2 && st[pos] >= y1)
        ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y1 - y2));
      if (st[pos] > y2)
        ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y1 - y2) +
                           2 * abs(st[pos] - y2));
      if (st[pos] < y1)
        ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y1 - y2) +
                           2 * abs(st[pos] - y1));
    }
    pos++;
  }
  pos = lower_bound(st.begin(), st.end(), y2) - st.begin();
  pos--;
  for (int i = 0; i < 3; i++) {
    if (pos >= 0 && pos < (st.size())) {
      if (st[pos] <= y2 && st[pos] >= y1)
        ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y1 - y2));
      if (st[pos] > y2)
        ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y1 - y2) +
                           2 * abs(st[pos] - y2));
      if (st[pos] < y1)
        ans = min(ans, (abs(x1 - x2) + v - 1) / v + abs(y1 - y2) +
                           2 * abs(st[pos] - y1));
    }
    pos++;
  }
  return ans;
}
int main() {
  int n, m, cl, cv, v;
  cin >> n >> m >> cl >> cv >> v;
  vector<int> stairs(cl), el(cv);
  for (int i = 0; i < cl; i++) cin >> stairs[i];
  for (int i = 0; i < cv; i++) cin >> el[i];
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int ans = 2e9;
    if (y1 > y2) swap(x1, x2), swap(y1, y2);
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    ans = min(ans, get(x1, y1, x2, y2, stairs, 1));
    ans = min(ans, get(x1, y1, x2, y2, el, v));
    cout << ans << endl;
  }
}
