#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;
}
