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 maxn = 100005;
int cl, ce, l[maxn], e[maxn], v;
int main() {
  int i, q, asdfasjdhfj, asfjgzxcvas, dsdcxocxbvd, fudgtuxcgvx, ans, x;
  scanf("%*d%*d%d%d%d", &cl, &ce, &v);
  for (i = 0; i < cl; i++) scanf("%d", &l[i]);
  for (i = 0; i < ce; i++) scanf("%d", &e[i]);
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d%d", &dsdcxocxbvd, &asdfasjdhfj, &fudgtuxcgvx, &asfjgzxcvas);
    if (dsdcxocxbvd == fudgtuxcgvx)
      printf("%d\n", abs(asfjgzxcvas - asdfasjdhfj));
    else {
      ans = 0x7fffffff;
      if (asdfasjdhfj > asfjgzxcvas) swap(asdfasjdhfj, asfjgzxcvas);
      if (cl) {
        x = lower_bound(l, l + cl, asdfasjdhfj) - l;
        if (x != cl && l[x] <= asfjgzxcvas)
          ans = asfjgzxcvas - asdfasjdhfj + abs(dsdcxocxbvd - fudgtuxcgvx);
        else {
          if (x != cl)
            ans = min(ans, l[x] - asdfasjdhfj + l[x] - asfjgzxcvas +
                               abs(dsdcxocxbvd - fudgtuxcgvx));
          if ((--x) >= 0)
            ans = min(ans, asdfasjdhfj - l[x] + asfjgzxcvas - l[x] +
                               abs(dsdcxocxbvd - fudgtuxcgvx));
        }
      }
      if (ce) {
        x = lower_bound(e, e + ce, asdfasjdhfj) - e;
        if (x != ce && e[x] <= asfjgzxcvas)
          ans = asfjgzxcvas - asdfasjdhfj +
                (abs(dsdcxocxbvd - fudgtuxcgvx) - 1) / v + 1;
        else {
          if (x != ce)
            ans = min(ans, e[x] - asdfasjdhfj + e[x] - asfjgzxcvas +
                               (abs(dsdcxocxbvd - fudgtuxcgvx) - 1) / v + 1);
          if ((--x) >= 0)
            ans = min(ans, asdfasjdhfj - e[x] + asfjgzxcvas - e[x] +
                               (abs(dsdcxocxbvd - fudgtuxcgvx) - 1) / v + 1);
        }
      }
      printf("%d\n", ans);
    }
  }
  return 0;
}
