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 main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  long long int n, m, ns, ne, speed;
  cin >> n >> m >> ns >> ne >> speed;
  vector<long long int> stair(ns), ele(ne);
  for (int i = 0; i < ns; i++) cin >> stair[i];
  for (int i = 0; i < ne; i++) cin >> ele[i];
  sort(stair.begin(), stair.end());
  sort(ele.begin(), ele.end());
  vector<long long int>::iterator itr, jtr;
  long long int q, sx, sy, ex, ey;
  cin >> q;
  while (q--) {
    cin >> sx >> sy >> ex >> ey;
    long long int ans = abs(ey - sy);
    if (sx == ex) {
      cout << ans << '\n';
      continue;
    }
    long long int zele = 999999999999999;
    if (sy > ey) swap(sy, ey);
    long long int f;
    if (ele.size() != 0) {
      zele = ceil(abs(ex - sx) / (speed * 1.00));
      f = 999999999999999;
      itr = lower_bound(ele.begin(), ele.end(), sy);
      if (itr != ele.end() && *itr <= ey)
        f = 0;
      else {
        if (itr != ele.end() && *itr > ey) f = min(f, (*itr - ey) * 2);
        if (itr != ele.begin()) {
          itr--;
          f = min(f, (sy - (*itr)) * 2);
        }
      }
      zele += f;
    }
    long long int zs = 9999999999999999;
    if (stair.size() != 0) {
      zs = abs(ex - sx);
      f = 9999999999999999;
      itr = lower_bound(stair.begin(), stair.end(), sy);
      if (itr != stair.end() && *itr <= ey)
        f = 0;
      else {
        if (itr != stair.end() && *itr > ey) f = min(f, (*itr - ey) * 2);
        if (itr != stair.begin()) {
          itr--;
          f = min(f, (sy - (*itr)) * 2);
        }
      }
      zs += f;
    }
    ans = ans + min(zele, zs);
    cout << ans << '\n';
  }
  return 0;
}
