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 n, m, c1, c2, v, q;
long long xs, xe, ye, ys;
long long pos1[100005];
long long pos2[100005];
long long solve(int pos, int v) {
  long long ans = abs(pos - xe) + abs(pos - xs);
  long long y = abs(ye - ys);
  ans += (y - 1) / v + 1;
  return ans;
}
int main() {
  cin >> n >> m >> c1 >> c2 >> v;
  for (int i = 0; i < c1; i++) cin >> pos1[i];
  for (int i = 0; i < c2; i++) cin >> pos2[i];
  cin >> q;
  while (q--) {
    int id;
    cin >> ys >> xs >> ye >> xe;
    long long ans = 999999999999;
    if (ys == ye)
      ans = abs(xe - xs);
    else {
      if (c1) {
        id = upper_bound(pos1, pos1 + c1, xs) - pos1;
        if (id != c1) ans = min(ans, solve(pos1[id], 1));
        if (id - 1 >= 0) ans = min(ans, solve(pos1[id - 1], 1));
        id = upper_bound(pos1, pos1 + c1, xe) - pos1;
        if (id != c1) ans = min(ans, solve(pos1[id], 1));
        if (id - 1 >= 0) ans = min(ans, solve(pos1[id - 1], 1));
      }
      if (c2) {
        id = upper_bound(pos2, pos2 + c2, xs) - pos2;
        if (id != c2) ans = min(ans, solve(pos2[id], v));
        if (id - 1 >= 0) ans = min(ans, solve(pos2[id - 1], v));
        id = upper_bound(pos2, pos2 + c2, xe) - pos2;
        if (id != c2) ans = min(ans, solve(pos2[id], v));
        if (id - 1 >= 0) ans = min(ans, solve(pos2[id - 1], v));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
