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> ds, de;
pair<int, int> bs(int x) {
  int a = 0;
  int b = ds.size() - 1;
  int s;
  if (ds.size() != 0) {
    while (b - a > 1) {
      int mid = (a + b) >> 1;
      if (ds[mid] >= x)
        b = mid;
      else
        a = mid;
    }
    if (abs(ds[b] - x) < abs(ds[a] - x))
      s = b;
    else
      s = a;
  } else
    s = -1;
  a = 0;
  b = de.size() - 1;
  int e;
  if (de.size() != 0) {
    while (b - a > 1) {
      int mid = (a + b) >> 1;
      if (de[mid] >= x)
        b = mid;
      else
        a = mid;
    }
    if (abs(de[b] - x) < abs(de[a] - x))
      e = b;
    else
      e = a;
  } else
    e = -1;
  int s1 = -1;
  int e1 = -1;
  if (s != -1) s1 = ds[s];
  if (e != -1) e1 = de[e];
  return make_pair(s1, e1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  for (int i = 0; i < s; ++i) {
    int x;
    cin >> x;
    ds.push_back(x);
  }
  for (int i = 0; i < e; ++i) {
    int x;
    cin >> x;
    de.push_back(x);
  }
  int q;
  cin >> q;
  while (q--) {
    int x, y, a, b;
    cin >> x >> y >> a >> b;
    pair<int, int> p = bs((y + b) / 2);
    long long d1 = 0;
    long long cs = p.first;
    long long ce = p.second;
    d1 = abs(cs - y) + abs(cs - b) + abs(x - a);
    long long plane = LLONG_MAX;
    if (x == a) {
      plane = abs(y - b);
    }
    if (cs == -1) d1 = LLONG_MAX;
    long long d2 = 0;
    int up = abs(x - a) / v;
    if (abs(x - a) % v != 0) up++;
    d2 = abs(ce - y) + abs(ce - b) + up;
    if (ce == -1) d2 = LLONG_MAX;
    cout << min(min(d1, d2), plane) << "\n";
  }
  return 0;
}
