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> v, v1;
int n, m, l, r, s, x, x1, y, theboatman, q;
int work() {
  int step = 1e9;
  int elev = 1e9;
  if (v.size()) {
    int id = lower_bound(v.begin(), v.end(), y) - v.begin();
    if (id < v.size()) {
      step = abs(x - x1) + abs(v[id] - y) + abs(v[id] - theboatman);
    }
    id--;
    if (id >= 0) {
      step = min(abs(x - x1) + abs(v[id] - y) + abs(v[id] - theboatman), step);
    }
  }
  if (v1.size()) {
    int f = (abs(x - x1) + s - 1) / s;
    int id = lower_bound(v1.begin(), v1.end(), y) - v1.begin();
    if (id < v1.size()) {
      elev = f + abs(v1[id] - y) + abs(v1[id] - theboatman);
    }
    id--;
    if (id >= 0) {
      elev = min(f + abs(v1[id] - y) + abs(v1[id] - theboatman), elev);
    }
  }
  return min(elev, step);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> n >> m >> l >> r >> s;
  for (int i = 0; i < l; i++) {
    cin >> x;
    v.push_back(x);
  }
  for (int i = 0; i < r; i++) {
    cin >> x;
    v1.push_back(x);
  }
  cin >> q;
  while (q--) {
    cin >> x >> y >> x1 >> theboatman;
    if (y > theboatman) swap(y, theboatman);
    if (x > x1) swap(x, x1);
    cout << work() << "\n";
  }
  return 0;
}
