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;
long long m, n, cl, ce, q, v;
long long l[100005], e[100005];
void input() {
  cin >> m >> n >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) cin >> l[i];
  for (int i = 0; i < ce; i++) cin >> e[i];
  l[cl] = e[ce] = 1e18 + 1;
}
long long calc(int y1, int y2, int len) {
  long long res = 2e18 + 1;
  long long pos = lower_bound(l, l + cl + 1, y1) - l;
  if (pos < cl) res = min(res, abs(y1 - l[pos]) + len + abs(y2 - l[pos]));
  if (pos > 0)
    res = min(res, abs(y1 - l[pos - 1]) + len + abs(y2 - l[pos - 1]));
  pos = lower_bound(e, e + ce + 1, y1) - e;
  if (pos < ce)
    res = min(res, abs(y1 - e[pos]) + (len - 1) / v + 1 + abs(y2 - e[pos]));
  if (pos > 0)
    res = min(res,
              abs(y1 - e[pos - 1]) + (len - 1) / v + 1 + abs(y2 - e[pos - 1]));
  return res;
}
void process() {
  long long x1, y1, x2, y2;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2)
      cout << abs(y1 - y2) << endl;
    else
      cout << min(calc(y1, y2, abs(x1 - x2)), calc(y2, y1, abs(x1 - x2)))
           << endl;
  }
}
int main() {
  cout << setprecision(10) << fixed;
  ios::sync_with_stdio(false), cin.tie(0);
  input();
  process();
  return 0;
}
