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>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using std::abs;
using std::cerr;
using std::cin;
using std::cout;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::set;
using std::string;
using std::swap;
using std::vector;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename T>
void _dbg(const char* _s, T _h) {
  cerr << _s << " = " << _h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* _s, T _h, Ts... _t) {
  int _b = 0;
  while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',') cerr << *_s++;
  cerr << " = " << _h << ",";
  _dbg(_s + 1, _t...);
}
struct init {
  init() {
    cin.tie(0);
    std::iostream::sync_with_stdio(0);
    cout << std::fixed << std::setprecision(10);
    cerr << std::fixed << std::setprecision(5);
    using namespace std::chrono;
    srand(duration_cast<nanoseconds>(
              high_resolution_clock::now().time_since_epoch())
              .count());
  }
  ~init() {}
} init;
const int MAXN = 1e5 + 15;
const ll INF = 1e16;
ll a[MAXN], b[MAXN];
int main() {
  ll n, m, ca, cb, v;
  cin >> n >> m >> ca >> cb >> v;
  a[0] = b[0] = -INF;
  for (int i = 1; i <= ca; ++i) cin >> a[i];
  for (int i = 1; i <= cb; ++i) cin >> b[i];
  a[ca + 1] = INF;
  b[cb + 1] = INF;
  ca += 2;
  cb += 2;
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << '\n';
      continue;
    }
    ll ans = INF * 10;
    {
      vector<ll> l = {*std::lower_bound(a, a + ca, y1),
                      *std::prev(std::lower_bound(a, a + ca, y1)),
                      *std::lower_bound(a, a + ca, y2),
                      *std::prev(std::lower_bound(a, a + ca, y2))};
      for (ll y : l) {
        ll pot = abs(y1 - y) + abs(y2 - y) + abs(x2 - x1);
        if (ans > pot) {
          ans = pot;
        }
      }
    }
    {
      vector<ll> l = {*std::lower_bound(b, b + cb, y1),
                      *std::prev(std::lower_bound(b, b + cb, y1)),
                      *std::lower_bound(b, b + cb, y2),
                      *std::prev(std::lower_bound(b, b + cb, y2))};
      for (ll y : l) {
        ll pot = abs(y1 - y) + abs(y2 - y) + (abs(x2 - x1) + v - 1) / v;
        if (ans > pot) {
          ans = pot;
        }
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
