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 long long int MOD = 1e9 + 7;
long long int mid;
long long int e[100000];
long long int s[100000];
long long int bss(long long int maxx, long long int minx, long long int l,
                  long long int r) {
  if (l + 1 >= r) {
    if (maxx <= s[l] <= minx) return l;
    if (maxx <= s[l] <= minx) return r;
    if (abs(s[l] - maxx) + abs(s[l] - minx) <=
        abs(s[r] - maxx) + abs(s[r] - minx))
      return l;
    return r;
  }
  mid = (l + r) / 2;
  if (s[mid] >= maxx)
    return bss(maxx, minx, l, mid);
  else
    return bss(maxx, minx, mid, r);
}
long long int bse(long long int maxx, long long int minx, long long int l,
                  long long int r) {
  if (l + 1 >= r) {
    if (maxx <= e[l] <= minx) return l;
    if (maxx <= e[l] <= minx) return r;
    if (abs(e[l] - maxx) + abs(e[l] - minx) <=
        abs(e[r] - maxx) + abs(e[r] - minx))
      return l;
    return r;
  }
  mid = (l + r) / 2;
  if (e[mid] >= maxx)
    return bse(maxx, minx, l, mid);
  else
    return bse(maxx, minx, mid, r);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m, cs, cl, v, q, x1, y1, x2, y2, bs1, bs2;
  cin >> n >> m >> cs >> cl >> v;
  for (long long int i = 0; i < cs; i++) cin >> s[i];
  for (long long int i = 0; i < cl; i++) cin >> e[i];
  cin >> q;
  for (long long int i = 0; i < q; i++) {
    cin >> y1 >> x1 >> y2 >> x2;
    bs1 = bss(max(x1, x2), min(x1, x2), 0, cs - 1);
    bs2 = bse(max(x1, x2), min(x1, x2), 0, cl - 1);
    cout << min(abs(s[bs1] - x1) + abs(s[bs1] - x2) + abs(y2 - y1),
                abs(e[bs2] - x1) + abs(e[bs2] - x2) + (abs(y2 - y1) + v) / v)
         << endl;
  }
  return 0;
}
