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 maxl = 3e5 + 10, max2 = 1e5 + 10;
int N, M, cl, ce, v, Q, ans[max2];
struct Node {
  int t, d, id;
  Node(int t = 0, int d = 0, int id = 0) : t(t), d(d), id(id) {}
  bool operator<(const Node &c1) const {
    if (d != c1.d) return d < c1.d;
    if (t != c1.t) return t < c1.t;
    return id < c1.id;
  }
  bool operator>(const Node &c1) const {
    if (d != c1.d) return d > c1.d;
    if (t != c1.t) return t < c1.t;
    return id < c1.id;
  }
} a[maxl];
struct Query {
  int x1, yyyyy1, x2, y2;
} q[max2];
int getdis(int x1, int x2, int n) { return abs(x1 - n) + abs(x2 - n); }
int main() {
  cin >> N >> M >> cl >> ce >> v;
  int top = 0;
  for (int i = 1; i <= cl; i++) {
    int x;
    cin >> x;
    a[++top] = Node(1, x, 0);
  }
  for (int i = 1; i <= ce; i++) {
    int x;
    cin >> x;
    a[++top] = Node(2, x, 0);
  }
  cin >> Q;
  for (int i = 1; i <= Q; i++) {
    int x1, yyyyy1, x2, y2;
    cin >> yyyyy1 >> x1 >> y2 >> x2;
    q[i] = Query{x1, yyyyy1, x2, y2};
    a[++top] = Node(3, x1, i);
  }
  for (int i = 1; i <= Q; i++) ans[i] = (int)1e7;
  sort(a + 1, a + top + 1, less<Node>());
  int ns = -1, ne = -1;
  for (int i = 1; i <= top; i++) {
    if (a[i].t == 1)
      ns = a[i].d;
    else if (a[i].t == 2)
      ne = a[i].d;
    else {
      int id = a[i].id;
      int x1 = q[id].x1, x2 = q[id].x2;
      int ydis = abs(q[id].yyyyy1 - q[id].y2);
      if (ydis == 0) ans[id] = min(ans[id], abs(x1 - x2));
      if (ns > 0) {
        int tmp = getdis(x1, x2, ns) + ydis;
        ans[id] = min(ans[id], tmp);
      }
      if (ne > 0) {
        int tmp = getdis(x1, x2, ns) + (ydis - 1) / v + 1;
        ans[id] = min(ans[id], tmp);
      }
    }
  }
  sort(a + 1, a + top + 1, greater<Node>());
  ns = -1, ne = -1;
  for (int i = 1; i <= top; i++) {
    if (a[i].t == 1)
      ns = a[i].d;
    else if (a[i].t == 2)
      ne = a[i].d;
    else {
      int id = a[i].id;
      int x1 = q[id].x1, x2 = q[id].x2;
      int ydis = abs(q[id].yyyyy1 - q[id].y2);
      if (ydis == 0) ans[id] = min(ans[id], abs(x1 - x2));
      if (ns > 0) {
        int tmp = getdis(x1, x2, ns) + ydis;
        ans[id] = min(ans[id], tmp);
      }
      if (ne > 0) {
        int tmp = getdis(x1, x2, ne) + (ydis - 1) / v + 1;
        ans[id] = min(ans[id], tmp);
      }
    }
  }
  for (int i = 1; i <= Q; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
