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 elev[100005];
long long lad[100005];
long long BinarySearchLast(long long val, long long mx, long long *mas) {
  long long p = 0;
  long long ost = mx;
  while (p <= ost) {
    long long mid = (p + ost) / 2;
    if (mas[mid] > val) {
      ost = mid - 1;
    } else {
      p = mid + 1;
    }
  }
  return p;
}
int main() {
  long long n, m, l, e, v;
  cin >> n >> m >> l >> e >> v;
  for (long long i = 1; i <= l; i++) {
    scanf("%lld", &lad[i]);
  }
  elev[0] = -1000000000005;
  elev[e + 1] = 1000000000005;
  lad[l + 1] = 1000000000005;
  for (long long i = 1; i <= e; i++) {
    scanf("%lld", &elev[i]);
  }
  lad[0] = -1000000000005;
  long long q;
  cin >> q;
  long long x1, y1, x2, y2;
  for (long long i = 0; i < q; i++) {
    scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      cout << abs(y2 - y1) << endl;
      continue;
    }
    long long indx1 = BinarySearchLast(y1, l + 1, lad);
    long long indx2 = BinarySearchLast(y1, e + 1, elev);
    long long ld1 = abs(lad[indx1] - y1) + abs(lad[indx1] - y2);
    long long ld2 = abs(lad[indx1 - 1] - y1) + abs(lad[indx1 - 1] - y2);
    long long ans1 = min(ld1, ld2) + abs(x1 - x2);
    long long elev1 = abs(elev[indx2] - y1) + abs(elev[indx2] - y2);
    long long elev2 = abs(elev[indx2 - 1] - y1) + abs(elev[indx2 - 1] - y2);
    long long ans2 =
        min(elev1, elev2) + abs(x2 - x1) / v + (abs(x2 - x1) % v != 0);
    cout << min(ans1, ans2) << endl;
  }
}
