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;
const long long nMax = 1e6;
const long long Mod = 1e9 + 7;
long long n, m, v, cs, ce;
vector<long long> Sta, Ele;
void _Input();
void _Process();
int main() {
  _Input();
  _Process();
  return 0;
}
void _Input() {
  long long pos;
  cin >> n >> m >> cs >> ce >> v;
  for (int i = 1; i <= cs; i++) cin >> pos, Sta.push_back(pos);
  for (int i = 1; i <= ce; i++) cin >> pos, Ele.push_back(pos);
}
void _Process() {
  int q, vt;
  long long kq, x1, y1, x2, y2;
  cin >> q;
  for (int i = 1; i <= q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (y1 > y2) {
      swap(y1, y2);
      swap(x1, x2);
    }
    kq = 1e18;
    vt = upper_bound(Sta.begin(), Sta.end(), y1) - 1 - Sta.begin();
    if (vt >= 0) {
      kq = min(kq, abs(x1 - x2) + y1 + y2 - 2 * Sta[vt]);
    }
    vt = lower_bound(Sta.begin(), Sta.end(), y1) - Sta.begin();
    if (vt != cs) {
      kq = min(kq, abs(x1 - x2) + Sta[vt] - y1 + abs(Sta[vt] - y2));
    }
    vt = lower_bound(Sta.begin(), Sta.end(), y2) - Sta.begin();
    if (vt != cs) {
      kq = min(kq, abs(x1 - x2) + 2 * Sta[vt] - y2 - y1);
    }
    vt = upper_bound(Ele.begin(), Ele.end(), y1) - 1 - Ele.begin();
    if (vt >= 0) {
      kq = min(kq, (abs(x1 - x2) + v - 1) / v + y1 + y2 - 2 * Ele[vt]);
    }
    vt = lower_bound(Ele.begin(), Ele.end(), y1) - Ele.begin();
    if (vt != ce) {
      kq = min(kq,
               (abs(x1 - x2) + v - 1) / v + Ele[vt] - y1 + abs(Ele[vt] - y2));
    }
    vt = lower_bound(Ele.begin(), Ele.end(), y2) - Ele.begin();
    if (vt != ce) {
      kq = min(kq, (abs(x1 - x2) + v - 1) / v + 2 * Ele[vt] - y2 - y1);
    }
    cout << kq << endl;
  }
}
