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;
const int inf = 1000000001;
const int MOD = 1000000007;
const int N = 100009;
int l[N + 1], e[N + 1];
set<int> s[2];
int v;
int get(int x1, int y1, int x2, int y2, int t) {
  if (t == 1) {
    set<int>::iterator it = s[t].lower_bound(x1);
    int cur = MOD;
    if (it != s[t].end()) {
      int val = *it;
      cur =
          min(cur, abs(x1 - val) + abs(x2 - val) + (abs(y1 - y2) + v - 1) / v);
    }
    if (it != s[t].begin()) {
      it--;
      int val = *it;
      cur =
          min(cur, abs(x1 - val) + abs(x2 - val) + (abs(y1 - y2) + v - 1) / v);
    }
    return cur;
  }
  if (t == 0) {
    set<int>::iterator it = s[t].lower_bound(x1);
    int cur = MOD;
    if (it == s[t].end()) {
      int val = *it;
      cur = min(cur, abs(x1 - val) + abs(x2 - val) + abs(y1 - y2));
    }
    if (it != s[t].begin()) {
      it--;
      int val = *it;
      cur = min(cur, abs(x1 - val) + abs(x2 - val) + abs(y1 - y2));
    }
    return cur;
  }
  return 0;
}
int main() {
  string prefixToFile = "/home/ballon/fbsource/fbcode/experimental/ballon/";
  string inputFile = prefixToFile + "input.txt";
  string outputFile = prefixToFile + "output.txt";
  int n, m, cl, ce, q;
  scanf("%d %d %d %d %d", &n, &m, &cl, &ce, &v);
  for (int i = (1); i <= (cl); ++i) {
    scanf("%d", &l[i]);
    s[0].insert(l[i]);
  }
  for (int i = (1); i <= (ce); ++i) {
    scanf("%d", &e[i]);
    s[1].insert(e[i]);
  }
  scanf("%d", &q);
  for (int iter = (1); iter <= (q); ++iter) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    swap(x1, y1);
    swap(x2, y2);
    int ans = MOD;
    for (int t = (0); t <= (1); ++t) {
      ans = min(ans, get(x1, y1, x2, y2, t));
      ans = min(ans, get(x2, y2, x1, y1, t));
    }
    printf("%d\n", ans);
  }
}
