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 n, m, c1, c2, v, q;
int main() {
  cin >> n >> m >> c1 >> c2 >> v;
  vector<int> v1, v2;
  int num;
  for (int i = 0; i < c1; i++) {
    scanf("%d", &num);
    v1.push_back(num);
  }
  for (int i = 0; i < c2; i++) {
    scanf("%d", &num);
    v2.push_back(num);
  }
  scanf("%d", &q);
  while (q--) {
    int x1, x2, y1, y2, ans = 0x3f3f3f3f;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int xx = abs(x1 - x2);
    int yy = (y1 + y2) / 2;
    if (xx == 0) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    int l = 0, r = c1 - 1;
    while (l < r) {
      int mid = l + r >> 1;
      if (v1[mid] > y1)
        r = mid;
      else
        l = mid + 1;
    }
    if (v1.size()) {
      ans = abs(y1 - v1[l]) + xx + abs(y2 - v1[l]);
      if (l - 1 >= 0)
        ans = min(ans, abs(y1 - v1[l - 1]) + xx + abs(y2 - v1[l - 1]));
    }
    l = 0, r = c2 - 1;
    while (l < r) {
      int mid = l + r >> 1;
      if (v2[mid] > y1)
        r = mid;
      else
        l = mid + 1;
    }
    if (v2.size()) {
      ans = min(ans,
                abs(y1 - v2[l]) + (int)ceil(xx / double(v)) + abs(y2 - v2[l]));
      if (l - 1 >= 0)
        ans = min(ans, abs(y1 - v2[l - 1]) + (int)ceil(xx / double(v)) +
                           abs(y2 - v2[l - 1]));
    }
    printf("%d\n", ans);
  }
  return 0;
}
