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;
int inf = (int)1e9 + 7;
struct fraction {
  int p;
  int q;
  friend bool operator<(fraction a, fraction b);
};
bool operator<(fraction a, fraction b) {
  return (long long)a.p * b.q < (long long)a.q * b.p;
}
void solve(istream &cin = std::cin, ostream &cout = std::cout) {
  int n, m, c_l, c_e, v;
  cin >> m >> n >> c_l >> c_e >> v;
  vector<int> ladders(c_l), elevs(c_e);
  for (int i = 0; i < c_l; i++) {
    cin >> ladders[i];
    ladders[i]--;
  }
  for (int i = 0; i < c_e; i++) {
    cin >> elevs[i];
    elevs[i]--;
  }
  int q;
  cin >> q;
  vector<pair<pair<int, int>, pair<int, int>>> queries;
  for (int i = 0; i < q; i++) {
    int x_1, y_1, x_2, y_2;
    cin >> y_1 >> x_1 >> y_2 >> x_2;
    x_1--, x_2--;
    queries.emplace_back(make_pair(x_1, x_2), make_pair(abs(y_1 - y_2), i));
    queries.emplace_back(make_pair(x_2, x_1), make_pair(abs(y_1 - y_2), i));
  }
  sort(queries.begin(), queries.end());
  int last_l = 0, last_e = 0;
  vector<int> ans(q, inf);
  for (auto query : queries) {
    while (last_l < c_l && ladders[last_l] < query.first.first) last_l++;
    while (last_e < c_e && elevs[last_e] < query.first.first) last_e++;
    if (last_l > 0) {
      ans[query.second.second] =
          min(ans[query.second.second],
              abs(query.first.first - ladders[last_l - 1]) +
                  abs(query.first.second - ladders[last_l - 1]) +
                  query.second.first);
    }
    if (last_l < c_l) {
      ans[query.second.second] = min(
          ans[query.second.second],
          abs(query.first.first - ladders[last_l]) +
              abs(query.first.second - ladders[last_l]) + query.second.first);
    }
    if (last_e > 0) {
      ans[query.second.second] =
          min(ans[query.second.second],
              abs(query.first.first - elevs[last_e - 1]) +
                  abs(query.first.second - elevs[last_e - 1]) +
                  (query.second.first + v - 1) / v);
    }
    if (last_e < c_e) {
      ans[query.second.second] =
          min(ans[query.second.second],
              abs(query.first.first - elevs[last_e]) +
                  abs(query.first.second - elevs[last_e]) +
                  (query.second.first + v - 1) / v);
    }
  }
  for (auto elem : ans) {
    cout << elem << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
