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 MAX_INT = 0x7fffffff;
int divs(int a, int n) {
  if (a % n == 0)
    return a / n;
  else
    return (a / n) + 1;
}
int main() {
  int n, m, cL, cE, v, q, time, ntime;
  scanf("%d %d %d %d %d", &n, &m, &cL, &cE, &v);
  int long double[cL], el[cE];
  for (auto i = 0; i < cL; i++) {
    scanf("%d", &long double[i]);
  }
  sort(&long double[0], &long double[cL]);
  for (auto i = 0; i < cE; i++) {
    scanf("%d", &el[i]);
  }
  sort(&el[0], &el[cE]);
  cin >> q;
  int x1, y1, x2, y2, timeelh, timeldh, timeel, timeld;
  for (auto i = 0; i < q; i++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    timeldh = abs(x2 - x1);
    timeelh = divs(timeldh, v);
    auto rld = upper_bound(&long double[0], &long double[cL], y1);
    auto lld = --rld;
    rld++;
    if (rld == &long double[cL]) rld = lld;
    if (*rld == long double[0]) lld = rld;
    auto rel = upper_bound(&el[0], &el[cE], y1);
    auto lel = --rel;
    rel++;
    if (rel == &el[cL]) rel = lel;
    if (*rel == el[0]) lel = rel;
    timeel = timeelh + min((abs(y1 - *lel) + abs(y2 - *lel)),
                           (abs(y2 - *rel) + abs(y1 - *rel)));
    timeld = timeldh + min((abs(y1 - *lld) + abs(y2 - *lld)),
                           (abs(y2 - *rld) + abs(y1 - *rld)));
    printf("%d\n", min(timeel, timeld));
  }
  return 0;
}
