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 = 1000000007;
int n, m, cl, ce, v;
int st[100007], ev[100007];
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  st[0] = 0;
  for (int i = 1; i <= cl; i++) {
    scanf("%d", st + i);
  }
  ev[0] = 0;
  for (int i = 1; i <= ce; i++) {
    scanf("%d", ev + i);
  }
  int q, a1, b1, a2, b2, s, e, sl, sr, el, er, ke, ks, ans, t;
  scanf("%d", &q);
  while (q != 0) {
    q--;
    scanf("%d%d%d%d", &a1, &b1, &a2, &b2);
    if (b1 > b2) {
      t = b1;
      b1 = b2;
      b2 = t;
      t = a1;
      a1 = a2;
      a2 = t;
    }
    s = lower_bound(st, st + cl + 1, b1) - st;
    e = lower_bound(ev, ev + ce + 1, b1) - ev;
    if (e != ce + 1 && ev[e] <= b2) {
      ans = b2 - b1 + abs(a1 - a2) / v + (abs(a1 - a2) % v != 0);
      printf("%d\n", ans);
      continue;
    } else {
      if (e == ce + 1) {
        er = inf;
      } else {
        er = ev[e];
      }
    }
    if (e > 1) {
      el = ev[e - 1];
    } else {
      el = -inf;
    }
    ke = min(b1 - el, er - b2);
    if (s != cl + 1 && st[s] <= b2) {
      ks = 0;
    } else {
      if (s > 1) {
        sl = st[s - 1];
      } else {
        sl = -inf;
      }
      if (s == cl + 1) {
        sr = inf;
      } else {
        sr = st[s];
      }
      ks = min(b1 - sl, sr - b2);
    }
    ans = min(b2 - b1 + 2 * ke + abs(a1 - a2) / v + (abs(a1 - a2) % v != 0),
              b2 - b1 + 2 * ks + abs(a1 - a2));
    printf("%d\n", ans);
  }
  return 0;
}
