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>
inline int pidorand() { return ((rand() & 32767) << 15) | (rand() & 32767); }
using namespace std;
inline int nxt() {
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  int n = nxt(), m = nxt();
  int n_l = nxt(), n_e = nxt();
  int v = nxt();
  vector<int> ls(n_l);
  vector<int> es(n_e);
  for (int i = 0; i < n_l; ++i) {
    ls[i] = nxt();
  }
  for (int i = 0; i < n_e; ++i) {
    es[i] = nxt();
  }
  int q = nxt();
  while (q--) {
    int x1 = nxt(), y1 = nxt(), x2 = nxt(), y2 = nxt();
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    int ans = 1e9;
    if (y1 > y2) {
      swap(y1, y2);
    }
    if (n_l) {
      auto it = lower_bound((ls).begin(), (ls).end(), y1);
      int opt = 1e9;
      if (it != ls.end()) {
        opt = min(opt, abs(*it - y1) + abs(*it - y2));
      }
      if (it != ls.begin()) {
        --it;
        opt = min(opt, abs(*it - y1) + abs(*it - y2));
      }
      ans = min(ans, abs(x1 - x2) + opt);
    }
    if (n_e) {
      auto it = lower_bound((es).begin(), (es).end(), y1);
      int opt = 1e9;
      if (it != es.end()) {
        opt = min(opt, abs(*it - y1) + abs(*it - y2));
      }
      if (it != es.begin()) {
        --it;
        opt = min(opt, abs(*it - y1) + abs(*it - y2));
      }
      ans = min(ans, (abs(x1 - x2) + v - 1) / v + opt);
    }
    printf("%d\n", ans);
  }
  return 0;
}
