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 step1(long long x1, long long y1, long long x2, long long y2,
                long long pos);
long long step2(long long x1, long long y1, long long x2, long long y2,
                long long pos, long long v);
long long CEIL(long long a, long long b) {
  if (a % b == 0)
    return a / b;
  else
    return (a / b + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, cl, ce, v, f1, f2;
  bool flag1 = false, flag2 = false;
  cin >> n >> m >> cl >> ce >> v;
  long long stairs[cl], elivator[ce];
  for (int i = 0; i < cl; i++) cin >> stairs[i];
  for (int i = 0; i < ce; i++) cin >> elivator[i];
  vector<long long> v1(stairs, stairs + cl);
  vector<long long> v2(elivator, elivator + ce);
  vector<long long>::iterator low;
  int q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (cl != 0) {
      flag1 = true;
      low = lower_bound(v1.begin(), v1.end(), y1);
      long long low1 = low - v1.begin();
      if (low1 != 0) low1--;
      f1 = step1(x1, y1, x2, y2, stairs[low1]);
    }
    if (ce != 0) {
      flag2 = true;
      low = lower_bound(v2.begin(), v2.end(), y1);
      long long low2 = low - v2.begin();
      if (low2 != 0) low2--;
      f2 = step2(x1, y1, x2, y2, elivator[low2], v);
    }
    if (flag1 == true && flag2 == true)
      cout << min(f1, f2) << "\n";
    else if (flag1 == true)
      cout << f1 << "\n";
    else
      cout << f2 << "\n";
  }
  return 0;
}
long long step1(long long x1, long long y1, long long x2, long long y2,
                long long pos) {
  return (abs(y1 - pos) + abs(y2 - pos) + abs(x1 - x2));
}
long long step2(long long x1, long long y1, long long x2, long long y2,
                long long pos, long long v) {
  return (CEIL(abs(x1 - x2), v) + abs(y1 - pos) + abs(y2 - pos));
}
