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 = 0x3f3f3f3f;
int n, m, cl, ce, v, q;
vector<int> str;
vector<int> el;
int se, sl;
int find_nearest(int x, vector<int> &base) {
  vector<int>::iterator low = lower_bound(base.begin(), base.end(), x);
  vector<int>::iterator up = upper_bound(base.begin(), base.end(), x);
  int vl = 0, vu = 0;
  if (*low == x && low != base.begin()) vl = *(low - 1);
  if (*low == x && low == base.begin()) vl = INF;
  if (up == base.end())
    vu = INF;
  else
    vu = *up;
  if (abs(vl - x) <= abs(vu - x)) return vl;
  return vu;
}
int query(int x1, int y1, int x2, int y2) {
  int me, ml, te, tl, pe, ps;
  if (sl == 0)
    tl = INF;
  else {
    if (sl == 1)
      ps = str[0];
    else
      ps = find_nearest(y1, str);
    tl = abs(y1 - ps) + abs(x1 - x2) + abs(ps - y2);
  }
  if (se == 0)
    te = INF;
  else {
    if (se == 1)
      pe = el[0];
    else
      pe = find_nearest(y1, el);
    te = abs(y1 - pe) + (abs(x1 - x2) + v - 1) / v + abs(y2 - pe);
  }
  return min(te, tl);
}
int main() {
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    int aux;
    cin >> aux;
    str.push_back(aux);
  }
  for (int i = 0; i < ce; i++) {
    int aux;
    cin >> aux;
    el.push_back(aux);
  }
  se = el.size();
  sl = str.size();
  sort(el.begin(), el.end());
  sort(str.begin(), str.end());
  cin >> q;
  for (int i = 0; i < q; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << query(x1, y1, x2, y2) << endl;
  }
  return 0;
}
