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>
const int inf = 0x7fffffff;
using namespace std;
typedef struct position {
  int pos;
  int type;
} position;
int binarysearchr(position* pos, int l, int r, int p) {
  int m;
  if (l == r && pos[l].pos != p) return l;
  m = (r + l) >> 1;
  if (pos[m].pos == p)
    return m;
  else if (p <= pos[m].pos)
    return binarysearchr(pos, l, m, p);
  else
    return binarysearchr(pos, m + 1, r, p);
}
int binarysearchl(position* pos, int l, int r, int p) {
  int m;
  if (l == r && pos[l].pos != p) return l;
  m = (r + l + 1) >> 1;
  if (pos[m].pos == p)
    return m;
  else if (p >= pos[m].pos)
    return binarysearchl(pos, m, r, p);
  else
    return binarysearchl(pos, l, m - 1, p);
}
position spos[100005];
position epos[100005];
int main() {
  int n, m, sc, ec, v;
  int psa, pea;
  int qc;
  cin >> n >> m >> sc >> ec >> v;
  psa = 1;
  for (int i = 0; i < sc; i++) {
    scanf("%d", &spos[psa].pos);
    spos[psa++].type = 1;
  }
  pea = 1;
  for (int i = 0; i < ec; i++) {
    scanf("%d", &epos[pea].pos);
    epos[pea++].type = 2;
  }
  spos[0].pos = 0;
  spos[psa].pos = inf;
  epos[0].pos = 0;
  epos[pea].pos = inf;
  cin >> qc;
  for (int i = 0; i < qc; i++) {
    int x1, y1, x2, y2;
    int st, et;
    int sl, sr;
    int el, er;
    long long ans = inf;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    st = ((x2 - x1) >= 0 ? (x2 - x1) : -(x2 - x1));
    et = (int)ceil(((x2 - x1) >= 0 ? (x2 - x1) : -(x2 - x1)) / (double)v);
    if (y1 > y2) swap(y1, y2);
    sl = binarysearchl(spos, 0, psa + 1, y1);
    el = binarysearchl(epos, 0, pea + 1, y1);
    if (sl && el) {
      if (y1 - spos[sl].pos + st <= y1 - epos[el].pos + et) {
        ans = y1 - spos[sl].pos + y2 - spos[sl].pos + st;
      } else {
        ans = y1 - epos[el].pos + y2 - epos[el].pos + et;
      }
    } else if (sl) {
      ans = y1 - spos[sl].pos + y2 - spos[sl].pos + st;
    } else if (el) {
      ans = y1 - epos[el].pos + y2 - epos[el].pos + et;
    }
    sr = binarysearchr(spos, 0, psa + 1, y2);
    er = binarysearchr(epos, 0, pea + 1, y2);
    if (sr < psa && er < pea) {
      if (spos[sr].pos - y2 + st <= epos[er].pos - y2 + et) {
        ans = min(ans, (long long)(spos[sr].pos - y2 + spos[sr].pos - y1 + st));
      } else {
        ans = min(ans, (long long)(epos[er].pos - y2 + epos[er].pos - y1 + et));
      }
    } else if (sr < psa) {
      ans = min(ans, (long long)(spos[sr].pos - y2 + spos[sr].pos - y1 + st));
    } else if (er < pea) {
      ans = min(ans, (long long)(epos[er].pos - y2 + epos[er].pos - y1 + et));
    }
    sr = binarysearchr(spos, 0, psa + 1, y2);
    er = binarysearchr(epos, 0, pea + 1, y2);
    sl = binarysearchr(spos, 0, psa + 1, y1);
    el = binarysearchr(epos, 0, pea + 1, y1);
    sr = min(sr, er);
    sl = min(sl, el);
    if (sr == sl) {
    } else {
      sl = binarysearchr(spos, 0, psa + 1, y1);
      el = binarysearchr(epos, 0, pea + 1, y1);
      if (el <= y2) {
        ans = min(ans, (long long)(y2 - y1 + et));
      } else if (sl <= y2) {
        ans = min(ans, (long long)(y2 - y1 + st));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
