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 comment(linker, "/STACK:336777216")
using namespace std;
const double pi = atan((double)1.0) * 4;
long long MOD = (long long)1e9 + 7;
long long power(long long n, long long k) {
  if (k == 0)
    return 1;
  else if (k == 1)
    return n;
  else {
    if (k % 2 == 0) {
      return power((n * n) % MOD, k / 2);
    } else {
      return (power((n * n) % MOD, k / 2) * n) % MOD;
    }
  }
}
long long modInv(long long n) { return power(n, MOD - 2); }
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <class T>
bool reverse_sort(T a, T b) {
  return a > b;
}
long long find_fast(vector<long long> &movement, long long movetype,
                    long long v, long long x1, long long y1, long long x2,
                    long long y2) {
  long long ans = LLONG_MAX;
  auto b = lower_bound(movement.begin(), movement.end(), y1);
  auto a = b;
  if (a != movement.begin()) {
    a--;
  }
  long long p = abs(x2 - x1);
  long long temp = p;
  if (movetype == 1) {
    p = p / v;
    if (temp % v != 0) p++;
  }
  if (a != movement.end()) {
    ans = min(ans, abs(*a - y2) + abs(*a - y1) + p);
  }
  if (b != movement.end()) {
    ans = min(ans, abs(*b - y2) + abs(*b - y1) + p);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  vector<long long> stairs;
  vector<long long> elevator;
  for (int i = 0; i < cl; i++) {
    long long k = 0;
    cin >> k;
    stairs.push_back(k);
  }
  for (int i = 0; i < ce; i++) {
    long long k = 0;
    cin >> k;
    elevator.push_back(k);
  }
  long long q = 0;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x2 == x1) {
      cout << abs(y1 - y2) << "\n";
      continue;
    }
    if (y1 > y2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    long long answer = LLONG_MAX;
    answer = min(answer, find_fast(stairs, 0, v, x1, y1, x2, y2));
    answer = min(answer, find_fast(elevator, 1, v, x1, y1, x2, y2));
    cout << answer << "\n";
  }
  return 0;
}
