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);
  long long int n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  vector<long long int> stair, elevetor;
  for (long long int i = 0; i < s; i++) {
    long long int in;
    cin >> in;
    stair.push_back(in);
  }
  for (long long int i = 0; i < e; i++) {
    long long int in;
    cin >> in;
    elevetor.push_back(in);
  }
  long long int q;
  cin >> q;
  while (q--) {
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    swap(x1, y1);
    swap(x2, y2);
    long long int ans = INT_MAX;
    if (stair.size() > 0) {
      auto ss = lower_bound(stair.begin(), stair.end(), x1);
      if (ss != stair.end()) {
        long long int s_location = *ss;
        long long int temp =
            abs(s_location - x1) + abs(s_location - x2) + (abs(y1 - y2));
        ans = min(ans, temp);
        if (ss != stair.begin()) {
          ss--;
          s_location = *ss;
          long long int temp1 =
              abs(s_location - x1) + abs(s_location - x2) + (abs(y1 - y2));
          ans = min(ans, temp1);
        }
      } else {
        ss--;
        long long int s_location = *ss;
        long long int temp1 =
            abs(s_location - x1) + abs(s_location - x2) + (abs(y1 - y2));
        ans = min(ans, temp1);
      }
    }
    if (elevetor.size() > 0) {
      auto ee = lower_bound(elevetor.begin(), elevetor.end(), x1);
      if (ee != elevetor.end()) {
        long long int e_location = *ee;
        long long int temp2 =
            abs(e_location - x1) + abs(e_location - x2) +
            ((abs(y1 - y2) % v == 0) ? (abs(y1 - y2) / v)
                                     : (abs(y1 - y2) / v + 1));
        ans = min(ans, temp2);
        if (ee != elevetor.begin()) {
          ee--;
          e_location = *ee;
          long long int temp3 =
              abs(e_location - x1) + abs(e_location - x2) +
              ((abs(y1 - y2) % v == 0) ? (abs(y1 - y2) / v)
                                       : (abs(y1 - y2) / v + 1));
          ans = min(ans, temp3);
        }
      } else {
        ee--;
        long long int e_location = *ee;
        long long int temp3 =
            abs(e_location - x1) + abs(e_location - x2) +
            ((abs(y1 - y2) % v == 0) ? (abs(y1 - y2) / v)
                                     : (abs(y1 - y2) / v + 1));
        ans = min(ans, temp3);
      }
    }
    cout << ans << endl;
  }
}
