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 main() {
  long long n, m, cl, ce, v, q;
  scanf("%lld %lld %lld %lld %lld ", &n, &m, &cl, &ce, &v);
  vector<long long> e, l;
  for (long long i = 1; i <= (long long)cl; ++i) {
    long long h;
    scanf("%lld", &h);
    l.push_back(h);
  }
  for (long long i = 1; i <= (long long)ce; ++i) {
    long long h;
    scanf("%lld", &h);
    e.push_back(h);
  }
  scanf("%lld", &q);
  for (int i = 1; i <= q; i++) {
    long long x, y, xx, yy;
    scanf("%lld %lld %lld %lld ", &x, &y, &xx, &yy);
    long long minl1, minl2, mine1, mine2;
    minl1 = minl2 = mine1 = mine2 = (long long)1e18;
    long long stair_pos1, ele_pos1, stair_pos2, ele_pos2;
    stair_pos1 = lower_bound(((l).begin()), ((l).end()), y) - l.begin();
    stair_pos2 = lower_bound(((l).begin()), ((l).end()), y) - l.begin() - 1;
    ele_pos1 = lower_bound(((e).begin()), ((e).end()), y) - e.begin();
    ele_pos2 = lower_bound(((e).begin()), ((e).end()), y) - e.begin() - 1;
    long long dis = abs(x - xx);
    if (stair_pos1 >= 0 && stair_pos1 < l.size())
      minl1 = dis + abs(l[stair_pos1] - y) + abs(l[stair_pos1] - yy);
    if (stair_pos2 >= 0 && stair_pos2 < l.size())
      minl2 = dis + abs(l[stair_pos2] - y) + abs(l[stair_pos2] - yy);
    if (ele_pos1 >= 0 && ele_pos1 < e.size())
      mine1 = (dis + v - 1) / v + abs(e[ele_pos1] - y) + abs(e[ele_pos1] - yy);
    if (ele_pos2 >= 0 && ele_pos2 < e.size())
      mine2 = (dis + v - 1) / v + abs(e[ele_pos2] - y) + abs(e[ele_pos2] - yy);
    printf("%lld\n", min(minl1, min(minl2, min(mine1, mine2))));
  }
}
