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 n, m, cl, ce, v, l[1000000], e[1000000], x1, x2, yy1, y2,
    maxim = 100, rez1 = 0, rez2 = 0, rez3 = 0, rez4 = 0, p3, p4, q;
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 1; i <= cl; i++) cin >> l[i];
  for (int i = 1; i <= ce; i++) cin >> e[i];
  l[0] = -1000000;
  e[0] = -1000000;
  l[cl + 1] = 1000000;
  e[ce + 1] = 10000000;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> yy1 >> x2 >> y2;
    rez1 = abs(l[upper_bound(l, l + cl, yy1) - l] - y2) + abs(x1 - x2) +
           abs(l[upper_bound(l, l + cl, yy1) - l] - yy1);
    rez2 = abs(l[upper_bound(l, l + cl, yy1) - l - 1] - y2) + abs(x1 - x2) +
           abs(l[upper_bound(l, l + cl, yy1) - l - 1] - yy1);
    p3 = abs(x1 - x2) / v;
    if (abs(x1 - x2) % v != 0) p3++;
    rez3 = p3 + abs(e[upper_bound(e, e + ce, yy1) - e] - y2) +
           abs(e[upper_bound(e, e + ce, yy1) - e] - yy1);
    rez4 = p3 + abs(e[upper_bound(e, e + ce, yy1) - e - 1] - y2) +
           abs(e[upper_bound(e, e + ce, yy1) - e - 1] - yy1);
    if (cl == 0) {
      rez1 = 10000000;
      rez2 = 10000000;
    }
    if (ce == 0) {
      rez3 = 10000000;
      rez4 = 10000000;
    }
    cout << (min(min(rez1, rez2), min(rez3, rez4))) << endl;
  }
  return 0;
}
