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 maxn = 1e5 + 5;
long long int n, m, sn, en, v, q, ans;
long long int s[maxn], e[maxn];
long long int xa, ya, xb, yb;
long long int bsfind(long long int y) {
  long long int l = 0, r = sn - 1, mid = (l + r) / 2;
  if (y <= s[0]) {
    return 0;
  }
  if (y >= s[sn - 1]) {
    return sn - 1;
  }
  while (l <= r) {
    if (s[mid] < y) {
      l = mid + 1;
      mid = (l + r) / 2;
    } else if (s[mid] > y) {
      r = mid - 1;
      mid = (l + r) / 2;
    } else {
      return mid;
    }
  }
  return (abs(y - s[r]) > abs(s[l] - y) ? l : r);
}
long long int befind(long long int y) {
  long long int l = 0, r = en - 1, mid = (l + r) / 2;
  if (y <= e[0]) {
    return 0;
  }
  if (y >= e[en - 1]) {
    return en - 1;
  }
  while (l <= r) {
    if (e[mid] < y) {
      l = mid + 1;
      mid = (l + r) / 2;
    } else if (e[mid] > y) {
      r = mid - 1;
      mid = (l + r) / 2;
    } else {
      return mid;
    }
  }
  return (abs(y - e[r]) > abs(e[l] - y) ? l : r);
}
long long int cal() {
  long long int sid = -1, eid = -1, stime = 0, etime = 0;
  if (sn != 0) sid = s[bsfind(ya)];
  if (en != 0) eid = e[befind(ya)];
  stime = abs(ya - sid) + abs(xb - xa) + abs(sid - yb);
  etime = abs(ya - eid) + abs(eid - yb);
  if (abs(xb - xa) % v == 0) {
    etime += abs(xb - xa) / v;
  } else {
    etime += abs(xb - xa) / v + 1;
  }
  if (sid == -1) return etime;
  if (eid == -1) return stime;
  return (stime > etime ? etime : stime);
}
int main(void) {
  cin >> n >> m >> sn >> en >> v;
  for (int i = 0; i < sn; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < en; i++) {
    cin >> e[i];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> xa >> ya >> xb >> yb;
    if (xa == xb)
      ans = abs(ya - yb);
    else
      ans = cal();
    cout << ans << endl;
  }
  return 0;
}
