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 n, m, cl, ce, v, q;
int e[100010], s[100010];
int main() {
  cin >> n >> m >> cl >> ce >> v;
  memset(e, 0, sizeof(e));
  memset(s, 0, sizeof(s));
  for (int i = 0; i < cl; i++) cin >> s[i];
  for (int i = 0; i < ce; i++) cin >> e[i];
  cin >> q;
  while (q--) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    int ans = 2147483646;
    int tmp = lower_bound(s, s + cl, y1) - s;
    if (tmp < cl) {
      ans = min(ans, abs(s[tmp] - y1) + abs(s[tmp] - y2) + abs(x1 - x2));
    }
    if (tmp > 0) {
      ans =
          min(ans, abs(s[tmp - 1] - y1) + abs(s[tmp - 1] - y2) + abs(x1 - x2));
    }
    tmp = lower_bound(e, e + ce, y1) - e;
    if (tmp < ce) {
      ans = min(ans, abs(e[tmp] - y1) + abs(e[tmp] - y2) +
                         (abs(x1 - x2) + v - 1) / v);
    }
    if (tmp > 0) {
      ans = min(ans, abs(e[tmp - 1] - y1) + abs(e[tmp - 1] - y2) +
                         (abs(x1 - x2) + v - 1) / v);
    }
    cout << ans << endl;
  }
  return 0;
}
