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 x, y, x2, y2;
int v;
vector<int> mass1, mass2;
int check1(int ind) {
  if (ind == -1 || ind == (int)mass1.size()) {
    return 1e9;
  }
  return abs(mass1[ind] - x) + abs(x2 - mass1[ind]) + (y2 - y + v - 1) / v;
}
int check2(int ind) {
  if (ind == -1 || ind == (int)mass2.size()) {
    return 1e9;
  }
  return abs(mass2[ind] - x) + abs(x2 - mass2[ind]) + (y2 - y);
}
signed main() {
  int n, m, c1, c2;
  cin >> n >> m >> c1 >> c2 >> v;
  mass1.resize(c2);
  mass2.resize(c1);
  for (int i = 0; i < c1; i++) {
    cin >> mass2[i];
  }
  for (int i = 0; i < c2; i++) {
    cin >> mass1[i];
  }
  int q;
  cin >> q;
  while (q--) {
    cin >> x >> y >> x2 >> y2;
    swap(x, y);
    swap(x2, y2);
    if (x > x2) {
      swap(x, x2);
    }
    if (y > y2) {
      swap(y, y2);
    }
    int ans = 1e9;
    if (y == y2) {
      ans = x2 - x;
    }
    int l1 = lower_bound(mass1.begin(), mass1.end(), x) - mass1.begin();
    ans = min(ans, check1(l1));
    ans = min(ans, check1(l1 - 1));
    l1 = lower_bound(mass1.begin(), mass1.end(), x2) - mass1.begin();
    ans = min(ans, check1(l1));
    ans = min(ans, check1(l1 - 1));
    l1 = lower_bound(mass2.begin(), mass2.end(), x) - mass2.begin();
    ans = min(ans, check2(l1));
    ans = min(ans, check2(l1 - 1));
    l1 = lower_bound(mass2.begin(), mass2.end(), x2) - mass2.begin();
    ans = min(ans, check2(l1));
    ans = min(ans, check2(l1 - 1));
    cout << ans << "\n";
  }
  return 0;
}
