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;
long long n, m, cl, ce, v;
vector<long long> s, e;
long long walk(long long x1, long long y1, long long x2, long long y2) {
  long long ans = 1e18;
  long long val = m - y1 + m - y2 + abs(x1 - x2);
  ans = min(ans, val);
  val = y1 - 1 + y2 - 1 + abs(x1 - x2);
  ans = min(ans, val);
  return ans;
}
long long stair(long long x1, long long y1, long long x2, long long y2) {
  long long val, ans = 1e18;
  long long ub = upper_bound(s.begin(), s.end(), y1) - s.begin();
  if (ub != s.size()) {
    long long pos = s[ub];
    val = pos - y1 + abs(pos - y2) + abs(x1 - x2);
    ans = min(ans, val);
  }
  long long lb = ub - 1;
  if (lb >= 0) {
    long long pos = s[lb];
    val = y1 - pos + abs(pos - y2) + abs(x1 - x2);
    ans = min(ans, val);
  }
  return ans;
}
long long ele(long long x1, long long y1, long long x2, long long y2) {
  long long ans = 1e18;
  long long ub = upper_bound(e.begin(), e.end(), y1) - e.begin();
  if (ub != e.size()) {
    long long pos = e[ub];
    long long diff = abs(x1 - x2);
    long long x = diff / v;
    long long t;
    if (x2 > x1)
      t = (v * x) + x1;
    else
      t = x1 - (v * x);
    long long val = pos - y1 + x;
    if (t != x2)
      ans = min(ans, val + stair(t, pos, x2, y2));
    else
      ans = min(ans, val + abs(pos - y2));
    x++;
    t = x2;
    val = pos - y1 + x + abs(pos - y2);
    ans = min(ans, val);
  }
  long long lb = ub - 1;
  if (lb >= 0) {
    long long pos = e[lb];
    long long diff = abs(x1 - x2);
    long long x = diff / v;
    long long t;
    if (x2 > x1)
      t = (v * x) + x1;
    else
      t = x1 - (v * x);
    long long val = y1 - pos + x;
    if (t != x2)
      ans = min(ans, val + stair(t, pos, x2, y2));
    else
      ans = min(ans, val + abs(pos - y2));
    x++;
    t = x2;
    val = y1 - pos + x + abs(pos - y2);
    ans = min(ans, val);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> cl >> ce >> v;
  long long i, x;
  for (i = 0; i < cl; i++) {
    cin >> x;
    s.push_back(x);
  }
  for (i = 0; i < ce; i++) {
    cin >> x;
    e.push_back(x);
  }
  long long q, x1, y1, x2, y2;
  cin >> q;
  while (q--) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2)
      cout << abs(y1 - y2);
    else {
      long long ans = 1e18;
      ans = min(ans, stair(x1, y1, x2, y2));
      ans = min(ans, ele(x1, y1, x2, y2));
      cout << ans;
    }
    cout << "\n";
  }
  return 0;
}
