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 arr[100005];
int s;
int main() {
  int n, m, s, e, v;
  scanf("%d %d %d %d %d", &n, &m, &s, &e, &v);
  vector<int> st(s), el(e);
  for (int i = 0; i < s; ++i) scanf("%d", &st[i]);
  for (int i = 0; i < e; ++i) scanf("%d", &el[i]);
  int q;
  scanf("%d", &q);
  int a, b, x, y;
  while (q--) {
    scanf("%d %d %d %d", &a, &b, &x, &y);
    long long ans = 1e17;
    auto str = lower_bound(st.begin(), st.end(), b);
    if (str != st.end()) {
      ans = min(ans, 0ll + abs(b - (*str)) + abs(y - (*str)) + abs(a - x));
    }
    if (str != st.begin()) {
      --str;
      ans = min(ans, 0ll + abs(b - (*str)) + abs(y - (*str)) + abs(a - x));
    }
    str = lower_bound(el.begin(), el.end(), b);
    if (str != el.end()) {
      long long dif = abs(a - x);
      dif = (dif + v - 1) / v;
      ans = min(ans, 0ll + abs(b - (*str)) + abs(y - (*str)) + dif);
    }
    if (str != el.begin()) {
      --str;
      long long dif = (dif + v - 1) / v;
      ans = min(ans, 0ll + abs(b - (*str)) + abs(y - (*str)) + dif);
    }
    printf("%lld\n", ans);
  }
}
