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(0);
  cout.tie(0);
  long long int n, m, stair, elevator, maximumDistance;
  cin >> n >> m >> stair >> elevator >> maximumDistance;
  vector<long long int> stairPosition;
  vector<long long int> elevatorPosition;
  for (long long int i = 0; i < stair; i++) {
    long long int b;
    cin >> b;
    stairPosition.push_back(b);
  }
  for (long long int i = 0; i < elevator; i++) {
    long long int b;
    cin >> b;
    elevatorPosition.push_back(b);
  }
  if (stairPosition.size() > 0)
    sort(stairPosition.begin(), stairPosition.end());
  sort(elevatorPosition.begin(), elevatorPosition.end());
  long long int q;
  cin >> q;
  while (q--) {
    long long int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y2 - y1) << endl;
      continue;
    }
    if (stairPosition.size() == 0) {
      long long int yDif = abs(y1 - y2);
      long long int lower =
          lower_bound(elevatorPosition.begin(), elevatorPosition.end(), y1) -
          elevatorPosition.begin();
      if (lower == elevatorPosition.size()) {
        lower--;
        long long int dif = abs(elevatorPosition[lower] - y1);
        long long int xDif = abs(x1 - x2);
        long long int vagfall = xDif / maximumDistance;
        if (xDif % maximumDistance != 0) vagfall++;
        dif += vagfall;
        dif += (abs(elevatorPosition[lower] - y2));
        cout << dif << endl;
        continue;
      }
      if (lower == 0) {
        long long int dif = abs(elevatorPosition[lower] - y1);
        long long int xDif = abs(x1 - x2);
        long long int vagfall = xDif / maximumDistance;
        if (xDif % maximumDistance != 0) vagfall++;
        dif += vagfall;
        dif += (abs(elevatorPosition[lower] - y2));
        cout << dif << endl;
        continue;
      }
      long long int protomMi, secondMi;
      long long int first = abs(elevatorPosition[lower] - y1);
      long long int second = abs(elevatorPosition[lower - 1] - y1);
      long long int mi = min(first, second);
      protomMi = first;
      secondMi = second;
      long long int xDif = abs(x1 - x2);
      long long int vagfall = xDif / maximumDistance;
      if (xDif % maximumDistance != 0) vagfall++;
      protomMi += vagfall;
      secondMi += vagfall;
      protomMi += (abs(elevatorPosition[lower] - y2));
      secondMi += (abs(elevatorPosition[lower - 1] - y2));
      cout << min(protomMi, secondMi) << endl;
      continue;
    }
    if (elevatorPosition.size() == 0) {
      long long int lower =
          lower_bound(stairPosition.begin(), stairPosition.end(), y1) -
          stairPosition.begin();
      if (lower == stairPosition.size()) {
        lower--;
        long long int dif = abs(stairPosition[lower] - y1);
        long long int xDif = abs(x1 - x2);
        dif += xDif;
        dif += (abs(stairPosition[lower] - y2));
        cout << dif << endl;
        continue;
      }
      if (lower == 0) {
        long long int dif = abs(stairPosition[lower] - y1);
        long long int xDif = abs(x1 - x2);
        dif += xDif;
        dif += (abs(stairPosition[lower] - y2));
        cout << dif << endl;
        continue;
      }
      long long int protomMi, secondMi;
      long long int first = abs(stairPosition[lower] - y1);
      long long int second = abs(stairPosition[lower - 1] - y1);
      protomMi = first;
      secondMi = second;
      long long int mi = min(first, second);
      long long int xDif = abs(x1 - x2);
      protomMi += xDif;
      secondMi += xDif;
      protomMi += (abs(stairPosition[lower] - y2));
      secondMi += (abs(stairPosition[lower - 1] - y2));
      cout << min(protomMi, secondMi) << endl;
      continue;
    }
    long long int lower =
        lower_bound(elevatorPosition.begin(), elevatorPosition.end(), y1) -
        elevatorPosition.begin();
    long long int ans;
    if (lower == elevatorPosition.size()) {
      lower--;
      long long int dif = abs(elevatorPosition[lower] - y1);
      long long int xDif = abs(x1 - x2);
      long long int vagfall = xDif / maximumDistance;
      if (xDif % maximumDistance != 0) vagfall++;
      dif += vagfall;
      dif += (abs(elevatorPosition[lower] - y2));
      ans = dif;
    } else if (lower == 0) {
      long long int dif = abs(elevatorPosition[lower] - y1);
      long long int xDif = abs(x1 - x2);
      long long int vagfall = xDif / maximumDistance;
      if (xDif % maximumDistance != 0) vagfall++;
      dif += vagfall;
      dif += (abs(elevatorPosition[lower] - y2));
      ans = dif;
    } else {
      long long int protomMi, secondMi;
      long long int first = abs(elevatorPosition[lower] - y1);
      long long int second = abs(elevatorPosition[lower - 1] - y1);
      protomMi = first, secondMi = second;
      long long int mi = min(first, second);
      long long int xDif = abs(x1 - x2);
      long long int vagfall = xDif / maximumDistance;
      if (xDif % maximumDistance != 0) vagfall++;
      secondMi += vagfall;
      protomMi += vagfall;
      protomMi += (abs(elevatorPosition[lower] - y2));
      secondMi += (abs(elevatorPosition[lower - 1] - y2));
      ans = min(protomMi, secondMi);
    }
    lower = lower_bound(stairPosition.begin(), stairPosition.end(), y1) -
            stairPosition.begin();
    long long int dum;
    if (lower == stairPosition.size()) {
      lower--;
      long long int dif = abs(stairPosition[lower] - y1);
      long long int xDif = abs(x1 - x2);
      dif += xDif;
      dif += (abs(stairPosition[lower] - y2));
      dum = dif;
    } else if (lower == 0) {
      long long int dif = abs(stairPosition[lower] - y1);
      long long int xDif = abs(x1 - x2);
      dif += xDif;
      dif += (abs(stairPosition[lower] - y2));
      dum = dif;
    } else {
      long long int protomMi, secondMi;
      long long int first = abs(stairPosition[lower] - y1);
      long long int second = abs(stairPosition[lower - 1] - y1);
      protomMi = first;
      secondMi = second;
      long long int mi = min(first, second);
      long long int xDif = abs(x1 - x2);
      protomMi += xDif;
      secondMi += xDif;
      mi += xDif;
      protomMi += (abs(stairPosition[lower] - y2));
      secondMi += (abs(stairPosition[lower - 1] - y2));
      dum = min(secondMi, protomMi);
    }
    cout << min(ans, dum) << endl;
  }
}
