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;
int main() {
  long long n, m, c1, c2, u, q;
  cin >> n >> m >> c1 >> c2 >> u;
  long long a[100001], b[100001];
  if (c1 != 0)
    for (int i = 0; i < c1; i++) cin >> a[i];
  if (c2 != 0)
    for (int i = 0; i < c2; i++) cin >> b[i];
  cin >> q;
  vector<long long> v;
  int i = -1;
  while (q) {
    long long onlift = LLONG_MAX, onstairs = LLONG_MAX;
    long long x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    long long lentostair = lower_bound(a, a + c1, y1) - a;
    long long res =
        abs(a[lentostair] - y1) + abs(x1 - x2) + abs(a[lentostair] - y2);
    long long res1 = abs(a[lentostair - 1] - y1) + abs(x1 - x2) +
                     abs(a[lentostair - 1] - y2);
    if (res < res1 && c1 != 0)
      onstairs = res;
    else if (c1 != 0)
      onstairs = res1;
    long long lentolift = lower_bound(b, b + c2, y1) - b;
    long long e = abs(x1 - x2);
    long long u1 = u;
    long long p;
    if (e % u1 == 0)
      p = e / u1;
    else
      p = (e / u1) + 1;
    res = abs(b[lentolift] - y1) + p + abs(b[lentolift] - y2);
    res1 = abs(b[lentolift - 1] - y1) + p + abs(b[lentolift - 1] - y2);
    if (res < res1 && c2 != 0)
      onlift = res;
    else if (c2 != 0)
      onlift = res1;
    if (onstairs <= onlift) {
      v.push_back(onstairs);
    } else {
      v.push_back(onlift);
    }
    q--;
  }
  copy(v.begin(), v.end(), ostream_iterator<int>(cout, "\n"));
  return 0;
}
