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 int INF = 2e9;
int n, m, cl, cee, v, s[100005], e[100005], cs[100005], ce[100005], bs[100005],
    be[100005];
struct qu {
  int x, y, xx, yy;
} q[100005];
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &cee, &v);
  s[0] = -1e9;
  for (int i = 1; i <= cl; i++) scanf("%d", &s[i]);
  s[++cl] = 1e9;
  e[0] = -1e9;
  for (int i = 1; i <= cee; i++) scanf("%d", &e[i]);
  e[++cee] = 1e9;
  int qe;
  scanf("%d", &qe);
  vector<int> ycor;
  for (int i = 0; i < qe; i++) {
    int x, y, xx, yy;
    scanf("%d%d%d%d", &q[i].x, &q[i].y, &q[i].xx, &q[i].yy);
    ycor.push_back(q[i].y);
  }
  sort(ycor.begin(), ycor.end());
  ycor.resize(unique(ycor.begin(), ycor.end()) - ycor.begin());
  int p = 0;
  int p1 = 0;
  for (int i = 0; i < ycor.size(); i++) {
    while (s[p + 1] <= ycor[i]) p++;
    cs[i] = p;
    while (e[p1 + 1] <= ycor[i]) p1++;
    ce[i] = p1;
  }
  p = cl;
  p1 = cee;
  for (int i = ycor.size() - 1; i >= 0; i--) {
    while (s[p - 1] >= ycor[i]) p--;
    bs[i] = p;
    while (e[p1 - 1] >= ycor[i]) p1--;
    be[i] = p1;
  }
  for (int i = 0; i < qe; i++) {
    int res = INF;
    int xx = abs(q[i].x - q[i].xx);
    int ind = lower_bound(ycor.begin(), ycor.end(), q[i].y) - ycor.begin();
    if (cs[ind] != 0)
      res = min(res, xx + abs(q[i].y - s[cs[ind]]) + abs(s[cs[ind]] - q[i].yy));
    if (bs[ind] != cl)
      res = min(res, xx + abs(q[i].y - s[bs[ind]]) + abs(s[bs[ind]] - q[i].yy));
    if (ce[ind] != 0)
      res = min(res, (int)ceil(xx * 1.0 / v) + abs(q[i].y - e[ce[ind]]) +
                         abs(e[ce[ind]] - q[i].yy));
    if (be[ind] != cee)
      res = min(res, (int)ceil(xx * 1.0 / v) + abs(q[i].y - e[be[ind]]) +
                         abs(e[be[ind]] - q[i].yy));
    if (xx == 0) res = min(res, abs(q[i].y - q[i].yy));
    printf("%d\n", res);
  }
}
