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 n, m, cl, ce, v;
int main() {
  int n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  int l[m + 1], s[m + 1], lr[m + 1], ll[m + 1], sr[m + 1], sl[m + 1];
  memset(l, 0, sizeof(l));
  memset(s, 0, sizeof(s));
  if (cl != 0)
    for (int i = 1; i <= cl; i++) {
      int t;
      cin >> t;
      s[t] = 1;
    }
  if (ce != 0)
    for (int i = 1; i <= cl; i++) {
      int t;
      cin >> t;
      l[t] = 1;
    }
  int li = -1;
  for (int i = 1; i <= m; i++) {
    if (l[i] == 1) li = i;
    ll[i] = li;
  }
  li = -1;
  for (int i = m; i >= 1; i--) {
    if (l[i] == 1) li = i;
    lr[i] = li;
  }
  int si = -1;
  for (int i = 1; i <= m; i++) {
    if (s[i] == 1) si = i;
    sl[i] = si;
  }
  si = -1;
  for (int i = m; i >= 1; i--) {
    if (s[i] == 1) si = i;
    sr[i] = si;
  }
  int q;
  cin >> q;
  for (int i = 1; i <= q; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int ans1, ans2, ans3, ans4;
    ans1 = 1000000000;
    ;
    ans2 = 1000000000;
    ;
    ans3 = 1000000000;
    ;
    ans4 = 1000000000;
    ;
    int r1;
    r1 = lr[y1];
    if (r1 != -1) {
      ans1 = ceil(abs(x2 - x1) * 1.0 / v) + abs(r1 - y1) + abs(y2 - r1);
    }
    int r2;
    r2 = ll[y1];
    if (r2 != -1) {
      ans2 = ceil(abs(x2 - x1) * 1.0 / v) + abs(r2 - y1) + abs(y2 - r2);
    }
    int r3;
    r3 = sl[y1];
    if (r3 != -1) {
      ans3 = abs(x2 - x1) + abs(r3 - y1) + abs(y2 - r3);
    }
    int r4;
    r4 = sr[y1];
    if (r4 != -1) {
      ans4 = abs(x2 - x1) + abs(r4 - y1) + abs(y2 - r4);
    }
    int ans = min(min(min(ans1, ans2), ans3), ans4);
    cout << ans << endl;
  }
  return 0;
}
