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;
vector<int> ast, lift;
int main() {
  int n, m, ca, cl, v;
  scanf("%d%d%d%d%d", &n, &m, &ca, &cl, &v);
  for (int i = 0; i < ca; i++) {
    int k;
    scanf("%d", &k);
    ast.push_back(k);
  }
  for (int i = 0; i < cl; i++) {
    int k;
    scanf("%d", &k);
    lift.push_back(k);
  }
  sort(ast.begin(), ast.end());
  sort(lift.begin(), lift.end());
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (y1 > y2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    if (x1 == x2) {
      printf("%d\n", max(y1 - y2, y2 - y1));
      continue;
    }
    int ans = 1000 * 1000 * 1000 + 1000;
    int l = -1, r = lift.size();
    while (r - l > 1) {
      int tm = (l + r) / 2;
      if (lift[tm] <= y1)
        l = tm;
      else
        r = tm;
    }
    if (lift.size() != 0) {
      if (l != -1) {
        int hans = abs(y1 - lift[l]) + abs(y2 - lift[l]);
        hans += (abs(x2 - x1) + v - 1) / v;
        ans = min(ans, hans);
      }
      if (l != lift.size() - 1) {
        l++;
        int hans = abs(y1 - lift[l]) + abs(y2 - lift[l]);
        hans += (abs(x2 - x1) + v - 1) / v;
        ans = min(ans, hans);
      }
    }
    l = -1, r = ast.size();
    while (r - l > 1) {
      int tm = (l + r) / 2;
      if (ast[tm] <= y1)
        l = tm;
      else
        r = tm;
    }
    if (ast.size() != 0) {
      if (l != -1) {
        int hans = abs(y1 - ast[l]) + abs(y2 - ast[l]);
        hans += (abs(x2 - x1));
        ans = min(ans, hans);
      }
      if (l != ast.size() - 1) {
        l++;
        int hans = abs(y1 - ast[l]) + abs(y2 - ast[l]);
        hans += (abs(x2 - x1));
        ans = min(ans, hans);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
