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;
template <typename node>
void read(node &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  x *= f;
}
int n, m, tx, ty, v;
long long st[100010], ev[100010];
long long solve1(int a, int b, int c, int d) {
  if (a == c) return abs(b - d);
  if (tx == 0) return INT_MAX;
  if (st[1] > b) return abs(a - c) + abs(b - st[1]) + abs(d - st[1]);
  if (st[tx] < b) return abs(a - c) + abs(b - st[tx]) + abs(d - st[tx]);
  int l = 1, r = tx, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (st[mid] < b)
      l = mid + 1, ans = mid;
    else
      r = mid - 1;
  }
  int dis1 = abs(a - c) + abs(b - st[ans]) + abs(d - st[ans]);
  int dis2 = abs(a - c) + abs(b - st[ans + 1]) + abs(d - st[ans + 1]);
  ;
  return min(dis1, dis2);
}
long long solve2(int a, int b, int c, int d) {
  if (a == c) return abs(b - d);
  if (ty == 0) return INT_MAX;
  if (ev[1] > b)
    return (abs(a - c) + v - 1) / v + abs(b - ev[1]) + abs(d - ev[1]);
  if (ev[ty] < b)
    return (abs(a - c) + v - 1) / v + abs(b - ev[ty]) + abs(d - ev[ty]);
  int l = 1, r = ty, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (ev[mid] < b)
      l = mid + 1, ans = mid;
    else
      r = mid - 1;
  }
  int dis1 = (abs(a - c) + v - 1) / v + abs(b - ev[ans]) + abs(d - ev[ans]);
  int dis2 =
      (abs(a - c) + v - 1) / v + abs(b - ev[ans + 1]) + abs(d - ev[ans + 1]);
  ;
  return min(dis1, dis2);
}
int main() {
  read(n), read(m), read(tx), read(ty), read(v);
  for (int i = 1; i <= tx; i++) read(st[i]);
  for (int i = 1; i <= ty; i++) read(ev[i]);
  sort(st + 1, st + tx + 1);
  sort(ev + 1, ev + ty + 1);
  int q;
  read(q);
  while (q--) {
    int a, b, c, d;
    read(a), read(b), read(c), read(d);
    printf("%I64d\n", min(solve1(a, b, c, d), solve2(a, b, c, d)));
  }
  return 0;
}
