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 = 998244353ll;
const long long int P = 1000000007ll;
const long long int N = 300005ll;
bool cmp(long long int x, long long int y) { return x > y; }
long long int n, m, cl, ce, v;
long long int fun(long long int x, long long int y, vector<long long int> &a) {
  if ((long long int)a.size() == 0) return 1e18;
  long long int l = 0;
  long long int r = (long long int)a.size() - 1;
  if (a[r] <= x) return 2 * (x - a[r]);
  if (a[l] >= y) return 2 * (a[l] - y);
  while (r > l) {
    long long int mid = (l + r) / 2;
    if (a[mid] >= x && a[mid] <= y)
      return 0;
    else if (a[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  long long int mini = 1e18;
  if (a[r] > y) mini = min(a[r] - y, mini);
  if (a[r] < x) mini = min(x - a[r], mini);
  if (r - 1 >= 0 && a[r - 1] < x) mini = min(x - a[r - 1], mini);
  if (r + 1 < (long long int)a.size() && a[r + 1] > y)
    mini = min(a[r + 1] - y, mini);
  return mini;
}
void solve() {
  cin >> n >> m >> cl >> ce >> v;
  vector<long long int> l(cl), e(ce);
  for (long long int i = (0); i <= (cl - 1); ++i) cin >> l[i];
  for (long long int i = (0); i <= (ce - 1); ++i) cin >> e[i];
  long long int q;
  cin >> q;
  while (q--) {
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long int x = min(fun(min(y1, y2), max(y1, y2), l) + abs(x1 - x2),
                          fun(min(y1, y2), max(y1, y2), e) + abs(x1 - x2) / v +
                              (abs(x1 - x2) % v ? 1 : 0));
    cout << abs(y1 - y2) + x << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
