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 res(vector<int>& v, int x) {
  int s = 0, e = v.size() - 1;
  int ans = -1;
  while (s <= e) {
    int mid = (s + e) / 2;
    if (v[mid] == x) return mid;
    if (v[mid] > x) {
      e = mid - 1;
      ans = mid;
    } else
      s = mid + 1;
  }
  return ans;
}
int les(vector<int>& v, int x) {
  int s = 0, e = v.size() - 1;
  int ans = -1;
  while (s <= e) {
    int mid = (s + e) / 2;
    if (v[mid] == x) return mid;
    if (v[mid] < x) {
      s = mid + 1;
      ans = mid;
    } else
      e = mid - 1;
  }
  return ans;
}
int main() {
  int n, m, cs, ce, v;
  cin >> n >> m >> cs >> ce >> v;
  vector<int> stairs(cs);
  for (int i = 0; i < cs; i++) cin >> stairs[i];
  vector<int> elevs(ce);
  for (int i = 0; i < ce; i++) cin >> elevs[i];
  int q;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    int re = -1, le = -1, rs = -1, ls = -1;
    int val = 1e9;
    re = res(elevs, y1);
    if (re == -1)
      re = val;
    else
      re = elevs[re] - y1 + abs(x2 - x1) / v + (abs(x2 - x1) % v != 0) +
           abs(elevs[re] - y2);
    le = les(elevs, y1);
    if (le == -1)
      le = val;
    else
      le = -elevs[le] + y1 + abs(x2 - x1) / v + (abs(x2 - x1) % v != 0) +
           abs(elevs[le] - y2);
    rs = res(stairs, y1);
    if (rs == -1)
      rs = val;
    else
      rs = stairs[rs] - y1 + abs(x2 - x1) + abs(y2 - stairs[rs]);
    ls = les(stairs, y1);
    if (ls == -1)
      ls = val;
    else
      ls = -stairs[ls] + y1 + abs(x2 - x1) + abs(y2 - stairs[ls]);
    vector<int> b;
    b.push_back(re);
    b.push_back(le);
    b.push_back(rs);
    b.push_back(ls);
    sort(b.begin(), b.end());
    cout << b[0] << endl;
  }
}
