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;
long long ss[100005];
long long ee[100005];
int main() {
  long long n, m, s, e, v;
  cin >> n >> m >> s >> e >> v;
  for (int i = 0; i < s; i++) {
    scanf("%lld", &ss[i]);
  }
  for (int i = 0; i < e; i++) {
    scanf("%lld", &ee[i]);
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    long long x1, x2, y1, y2;
    scanf("%lld %lld %lld %lld", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    long long ans = 0;
    if (s == 1 && e == 0) {
      if ((y1 <= ss[0] && y2 >= ss[0]) || (y1 >= ss[0] && y2 <= ss[0])) {
        ans += abs(y2 - y1);
        ans += abs(x2 - x1);
      } else {
        ans += abs(x2 - x1);
        ans += abs(y2 + y1 - ss[0] * 2);
      }
    } else if (s == 0 && e == 1) {
      if ((y1 <= ee[0] && y2 >= ee[0]) || (y1 >= ee[0] && y2 <= ee[0])) {
        ans += abs(x2 - x1) / v;
        ans += abs(y2 - y1);
        if (abs(x2 - x1) % v) ans++;
      } else {
        ans += abs(y2 + y1 - ee[0] * 2);
        ans += abs(x2 - x1) / v;
        if (abs(x2 - x1) % v) ans++;
      }
    } else {
      long long tmp1 = 0;
      long long tmp2 = 0;
      tmp1 += abs(x2 - x1);
      tmp2 += abs(x2 - x1) / v;
      if (abs(x2 - x1) % v) tmp2++;
      int l = 0;
      int r = s - 1;
      long long aans = 100000000000;
      while (l <= r) {
        int mid = (l + r) / 2;
        if ((y1 <= ss[mid] && y2 >= ss[mid]) ||
            (y1 >= ss[mid] && y2 <= ss[mid])) {
          aans = abs(y2 - y1);
          break;
        } else if (ss[mid] < min(y1, y2)) {
          long long tmp = abs(y2 + y1 - ss[mid] * 2);
          if (tmp < aans) aans = tmp;
          l = mid + 1;
        } else {
          long long tmp = abs(y2 + y1 - ss[mid] * 2);
          if (tmp < aans) aans = tmp;
          r = mid - 1;
        }
      }
      tmp1 += aans;
      l = 0;
      r = e - 1;
      aans = 100000000000;
      while (l <= r) {
        int mid = (l + r) / 2;
        if ((y1 <= ee[mid] && y2 >= ee[mid]) ||
            (y1 >= ee[mid] && y2 <= ee[mid])) {
          aans = abs(y2 - y1);
          break;
        } else if (ee[mid] < min(y1, y2)) {
          long long tmp = abs(y2 + y1 - ee[mid] * 2);
          if (tmp < aans) aans = tmp;
          l = mid + 1;
        } else {
          long long tmp = abs(y2 + y1 - ee[mid] * 2);
          if (tmp < aans) aans = tmp;
          r = mid - 1;
        }
      }
      tmp2 += aans;
      ans = min(tmp1, tmp2);
    }
    cout << ans << endl;
  }
  return 0;
}
