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 li[100005];
int ei[100005];
int n, m, cl, ce, v;
int x1, y1_, x2, y2;
int safe(int* l, int len, int* pos) { return pos >= l && pos < l + len; }
int distance(int num) { return abs(y1_ - num) + abs(y2 - num); }
int useI(int* l, int len) {
  int minans = 0x3F3F3F3F;
  int* low;
  low = lower_bound(l, l + len, y1_);
  if (safe(l, len, low - 1)) {
    minans = min(minans, distance(*(low - 1)));
  }
  if (safe(l, len, low)) {
    minans = min(minans, distance(*(low)));
  }
  if (safe(l, len, low + 1)) {
    minans = min(minans, distance(*(low + 1)));
  }
  low = lower_bound(l, l + len, y2);
  if (safe(l, len, low - 1)) {
    minans = min(minans, distance(*(low - 1)));
  }
  if (safe(l, len, low)) {
    minans = min(minans, distance(*(low)));
  }
  if (safe(l, len, low + 1)) {
    minans = min(minans, distance(*(low + 1)));
  }
  return minans;
}
int main(int argc, char const* argv[]) {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 0; i < cl; ++i) {
    scanf("%d", li + i);
  }
  for (int i = 0; i < ce; ++i) {
    scanf("%d", ei + i);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &x1, &y1_, &x2, &y2);
    if (x1 == x2) {
      printf("%d\n", abs(y1_ - y2));
    } else if (cl && ce) {
      printf("%d\n", min(abs(x1 - x2) + useI(li, cl),
                         ((abs(x1 - x2)) / v) + (((abs(x1 - x2)) % v) ? 1 : 0) +
                             useI(ei, ce)));
    } else if (cl) {
      printf("%d\n", abs(x1 - x2) + useI(li, cl));
    } else if (ce) {
      printf("%d\n", ((abs(x1 - x2)) / v) + (((abs(x1 - x2)) % v) ? 1 : 0) +
                         useI(ei, ce));
    }
  }
  return 0;
}
