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;
const int N = 100101;
using l2 = long long;
l2 st[N], n, m, cl, ce, v, ele[N], x, y, x2, y2;
l2 ck() {
  int ans = 1e9;
  if (x == x2) {
    return abs(y2 - y);
  }
  int up = upper_bound(st, st + cl, y) - st;
  if (up < cl) {
    int t = abs(st[up] - y);
    t += abs(x2 - x);
    t += abs(st[up] - y2);
    ans = min(ans, t);
  }
  if (up) {
    --up;
    int t = abs(st[up] - y) + abs(x2 - x) + abs(y2 - st[up]);
    ans = min(ans, t);
  }
  up = upper_bound(ele, ele + ce, y) - ele;
  if (up < ce) {
    int t = (ele[up] - y) + (abs(x2 - x) + v - 1) / v + abs(y2 - ele[up]);
    ans = min(ans, t);
  }
  if (up) {
    --up;
    int t = abs(ele[up] - y) + (abs(x2 - x) + v - 1) / v + abs(y2 - ele[up]);
    ans = min(ans, t);
  }
  return ans;
}
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) cin >> st[i];
  for (int i = 0; i < ce; i++) cin >> ele[i];
  int q;
  cin >> q;
  while (q--) {
    cin >> x >> y >> x2 >> y2;
    l2 l = 0, r = 1e8, ans = ck();
    cout << ans << endl;
  }
}
