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>
#pragma GCC optimize("O2")
using namespace std;
long long n, m, l, s, vl[100002], vs[100002], spl;
long long q, xa, ya, xb, yb;
long long bls(long long nr) {
  if (nr < vl[1]) return -1;
  int b = 1;
  int e = l;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vl[mid] <= nr)
      sol = vl[mid], b = mid + 1;
    else
      e = mid - 1;
  }
  return sol;
}
long long blr(long long nr) {
  if (nr > vl[l]) return -1;
  int b = 1;
  int e = l;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vl[mid] >= nr)
      sol = vl[mid], e = mid - 1;
    else
      b = mid + 1;
  }
  return sol;
}
long long bss(long long nr) {
  if (nr < vs[1]) return -1;
  int b = 1;
  int e = s;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vs[mid] <= nr)
      sol = vs[mid], b = mid + 1;
    else
      e = mid - 1;
  }
  return sol;
}
long long bsr(long long nr) {
  if (nr > vs[s]) return -1;
  int b = 1;
  int e = s;
  long long sol = -1;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (vs[mid] >= nr)
      sol = vs[mid], e = mid - 1;
    else
      b = mid + 1;
  }
  return sol;
}
long long solve(long long xa, long long ya, long long xb, long long yb) {
  long long mint = (1LL << 60);
  if (bss(ya) != -1)
    mint = min(mint, ya - bss(ya) + (xb - xa) + abs(bss(ya) - yb));
  if (bsr(ya) != -1)
    mint = min(mint, bsr(ya) - ya + (xb - xa) + abs(bsr(ya) - yb));
  long long tt = (xb - xa) / spl + (((xb - xa) % spl) > 0);
  if (bls(ya) != -1) mint = min(mint, ya - bls(ya) + tt + abs(bls(ya) - yb));
  if (blr(ya) != -1) mint = min(mint, blr(ya) - ya + tt + abs(blr(ya) - yb));
  return mint;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> s >> l >> spl;
  for (int i = 1; i <= s; ++i) cin >> vs[i];
  for (int i = 1; i <= l; ++i) cin >> vl[i];
  cin >> q;
  for (int i = 1; i <= q; ++i) {
    cin >> xa >> ya >> xb >> yb;
    if (xa > xb) {
      swap(xa, xb);
      swap(ya, yb);
    } else if (xa == xb && ya > yb)
      swap(ya, yb);
    if (xa == xb)
      cout << yb - ya << '\n';
    else
      cout << solve(xa, ya, xb, yb) << '\n';
  }
  return 0;
}
