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 n, m, cl, ce, v;
vector<int> l, e;
int q;
void solve(int b, int a, int d, int c) {
  int etime, stime;
  stime = abs(b - d);
  etime = stime;
  if ((abs(b - d) + v - 1) / v < etime) etime = (abs(b - d) + v - 1) / v;
  if (abs(b - d) / v + (abs(b - d) % v) < etime)
    etime = abs(b - d) / v + (abs(b - d) % v);
  int M = 2 * n + 2 * m;
  int k, j;
  k = 0;
  j = cl - 1;
  int r;
  bool eizmedu, sizmedu;
  eizmedu = false;
  sizmedu = false;
  if (cl > 0) {
    while (k != j) {
      r = (k + j) / 2;
      if (l[r] < a && l[r] < c)
        k = r + 1;
      else
        j = r;
    }
    if ((l[k] >= a && l[k] <= c) || (l[k] <= a && l[k] >= c)) {
      M = abs(c - a) + stime;
      sizmedu = true;
    }
  }
  k = 0;
  j = ce - 1;
  if (ce > 0) {
    while (k != j) {
      r = (k + j) / 2;
      if (e[r] < a && e[r] < c)
        k = r + 1;
      else
        j = r;
    }
    if (((e[k] >= a) && (e[k] <= c)) or ((e[k] <= a) && (e[k] >= c))) {
      eizmedu = true;
      if (abs(c - a) + etime < M) M = abs(c - a) + etime;
    }
  }
  if (!sizmedu && cl > 0) {
    k = 0;
    j = cl - 1;
    while (k != j) {
      if (a < l[k]) {
        j = k;
        continue;
      }
      if (a > l[j]) {
        k = j;
        continue;
      }
      r = (k + j) / 2;
      if (l[r] < a) k = r;
      if (l[r] > a) j = r;
      if (j == k + 1) {
        if (l[j] - a < a - l[k])
          k = j;
        else
          j = k;
      }
    }
    if (abs(a - l[k]) + abs(c - l[k]) + stime < M)
      M = abs(a - l[k]) + abs(c - l[k]) + stime;
    k = 0;
    j = cl - 1;
    while (k != j) {
      if (c < l[k]) {
        j = k;
        continue;
      }
      if (c > l[j]) {
        k = j;
        continue;
      }
      r = (k + j) / 2;
      if (l[r] < c) k = r;
      if (l[r] > c) j = r;
      if (j == k + 1) {
        if (l[j] - c < c - l[k])
          k = j;
        else
          j = k;
      }
    }
    if (abs(a - l[k]) + abs(c - l[k]) + stime < M)
      M = abs(a - l[k]) + abs(c - l[k]) + stime;
  }
  if (!eizmedu && ce > 0) {
    k = 0;
    j = ce - 1;
    while (k != j) {
      if (a < e[k]) {
        j = k;
        continue;
      }
      if (a > e[j]) {
        k = j;
        continue;
      }
      r = (k + j) / 2;
      if (e[r] < a) k = r;
      if (e[r] > a) j = r;
      if (j == k + 1) {
        if (e[j] - a < a - e[k])
          k = j;
        else
          j = k;
      }
    }
    if (abs(c - e[k]) + abs(a - e[k]) + etime < M)
      M = abs(c - e[k]) + abs(a - e[k]) + etime;
    k = 0;
    j = ce - 1;
    while (k != j) {
      if (c < e[k]) {
        j = k;
        continue;
      }
      if (c > e[j]) {
        k = j;
        continue;
      }
      r = (k + j) / 2;
      if (e[r] < c) k = r;
      if (e[r] > c) j = r;
      if (j == k + 1) {
        if (e[j] - c < c - e[k])
          k = j;
        else
          j = k;
      }
    }
    if (abs(a - e[k]) + abs(c - e[k]) + etime < M)
      M = abs(a - e[k]) + abs(c - e[k]) + etime;
  }
  cout << M << endl;
}
int main() {
  cin >> n >> m >> cl >> ce >> v;
  int a, b, c, d;
  for (int i = 0; i < cl; i++) {
    cin >> a;
    l.push_back(a);
  }
  for (int i = 0; i < ce; i++) {
    cin >> a;
    e.push_back(a);
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> a >> b >> c >> d;
    solve(a, b, c, d);
  }
  return 0;
}
