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;
void _add(long long &a, long long b) { a = (a + b) % 1000000007; }
void _sub(long long &a, long long b) { a = (a + 1000000007 - b) % 1000000007; }
void _mul(long long &a, long long b) { a = (long long)a * b % 1000000007; }
void _max(int &a, int b) { a = max(a, b); }
void _min(int &a, int b) { a = min(a, b); }
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long pow(long long a, long long b) {
  long long res(1);
  while (b) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
    b >>= 1;
  }
  return res;
}
long long powM(long long a, long long b, long long mod) {
  long long res(1);
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
const int infi = 2147483647;
const long long infl = 9223372036854775807ll;
const double PI = 3.14159265358979323846;
int n, m, k, T;
int l[100010], e[100010], l1[100010], e1[100010];
struct query {
  int x1, y1, x2, y2, ans, i;
} q[100010];
vector<int> hh;
int main() {
  int cl, ce, v;
  scanf("%d", &n), scanf("%d", &m), scanf("%d", &cl), scanf("%d", &ce),
      scanf("%d", &v);
  for (int i = 0, lim = cl - 1; i <= lim; ++i)
    scanf("%d", &l[i]), l1[cl - i - 1] = -l[i];
  for (int i = 0, lim = ce - 1; i <= lim; ++i)
    scanf("%d", &e[i]), e1[ce - i - 1] = -e[i];
  scanf("%d", &k);
  for (int i = 1, lim = k; i <= lim; ++i) {
    scanf("%d", &q[i].x1), scanf("%d", &q[i].y1), scanf("%d", &q[i].x2),
        scanf("%d", &q[i].y2), q[i].i = i;
    int h = abs(q[i].x1 - q[i].x2);
    int ans = h ? infi : abs(q[i].y1 - q[i].y2);
    if (cl) {
      int a1 = upper_bound(l1, l1 + cl, -q[i].y1) - l1;
      if (a1 < cl)
        ans = min(ans, h + abs(q[i].y1 + l1[a1]) + abs(q[i].y2 + l1[a1]));
      int a2 = upper_bound(l1, l1 + cl, -q[i].y2) - l1;
      if (a2 < cl)
        ans = min(ans, h + abs(q[i].y1 + l1[a2]) + abs(q[i].y2 + l1[a2]));
      int a3 = upper_bound(l, l + cl, q[i].y1) - l;
      if (a3 < cl)
        ans = min(ans, h + abs(q[i].y1 - l[a3]) + abs(q[i].y2 - l[a3]));
      int a4 = upper_bound(l, l + cl, q[i].y2) - l;
      if (a4 < cl)
        ans = min(ans, h + abs(q[i].y1 - l[a4]) + abs(q[i].y2 - l[a4]));
    }
    if (!ce) continue;
    h = (h + v - 1) / v;
    int a5 = upper_bound(e1, e1 + ce, -q[i].y1) - e1;
    if (a5 < ce)
      ans = min(ans, h + abs(q[i].y1 + e1[a5]) + abs(q[i].y2 + e1[a5]));
    int a6 = upper_bound(e1, e1 + ce, -q[i].y2) - e1;
    if (a6 < ce)
      ans = min(ans, h + abs(q[i].y1 + e1[a6]) + abs(q[i].y2 + e1[a6]));
    int a7 = upper_bound(e, e + ce, q[i].y1) - e;
    if (a7 < ce)
      ans = min(ans, h + abs(q[i].y1 - e[a7]) + abs(q[i].y2 - e[a7]));
    int a8 = upper_bound(e, e + ce, q[i].y2) - e;
    if (a8 < ce)
      ans = min(ans, h + abs(q[i].y1 - e[a8]) + abs(q[i].y2 - e[a8]));
    printf("%d", (ans)), putchar('\n');
  }
  return 0;
}
