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>
int e[100000];
int s[100000];
int bs(int p, int k, int sz, int n) {
  if (n == 1) {
    if (e[(p + k) / 2] < sz && e[(p + k) / 2 + 1] > sz) return ((p + k) / 2);
    if (e[(p + k) / 2] < sz && e[(p + k) / 2 + 1] < sz)
      return (bs((p + k) / 2, k, sz, n));
    if (e[(p + k) / 2] > sz && e[(p + k) / 2 + 1] > sz)
      return (bs(p, (p + k) / 2, sz, n));
  }
  if (s[(p + k) / 2] < sz && s[(p + k) / 2 + 1] > sz) return ((p + k) / 2);
  if (s[(p + k) / 2] < sz && s[(p + k) / 2 + 1] < sz)
    return (bs((p + k) / 2, k, sz, n));
  if (s[(p + k) / 2] > sz && s[(p + k) / 2 + 1] > sz)
    return (bs(p, (p + k) / 2, sz, n));
}
int war(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int main() {
  int n, m, v, a, b, w, i, q, c[4], xp, xd, yp, yd;
  scanf("%d%d%d%d%d", &m, &n, &a, &b, &v);
  for (i = 0; i < a; i++) {
    scanf("%d", &s[i]);
  }
  for (i = 0; i < b; i++) {
    scanf("%d", &e[i]);
  }
  qsort(s, a, 4, war);
  qsort(e, b, 4, war);
  w = 0;
  scanf("%d", &q);
  for (i = 0; i < q; i++) {
    scanf("%d%d%d%d", &yp, &xp, &yd, &xd);
    if (yd == yp) {
      if (xd > xp)
        printf("%d\n", xd - xp);
      else
        printf("%d\n", xp - xd);
    } else {
      if (xp < e[0] && b != 0) {
        c[0] = 10000009000;
        c[1] = e[0] - xp;
        if (yp - yd > 0)
          c[1] += (yp - yd + v - 1) / v;
        else
          c[1] += (yd - yp + v - 1) / v;
        if (xd - e[0] > 0)
          c[1] += xd - e[0];
        else
          c[1] += e[0] - xd;
      }
      if (xp > e[b - 1] && b != 0) {
        c[0] = 10000000900;
        c[1] = xp - e[b - 1];
        if (yp - yd > 0)
          c[1] += (yp - yd + v - 1) / v;
        else
          c[1] += (yd - yp + v - 1) / v;
        if (xd - e[b - 1] > 0)
          c[1] += xd - e[b - 1];
        else
          c[1] += e[b - 1] - xd;
      }
      if (xp < e[b - 1] && xp > e[0] && b != 0) {
        w = bs(0, b - 1, xp, 1);
        c[1] = xp - e[w];
        if (yp - yd > 0)
          c[1] += (yp - yd + v - 1) / v;
        else
          c[1] += (yd - yp + v - 1) / v;
        if (xd - e[w] > 0)
          c[1] += xd - e[w];
        else
          c[1] += e[w] - xd;
        w++;
        c[0] = e[w] - xp;
        if (yp - yd > 0)
          c[0] += (yp - yd + v - 1) / v;
        else
          c[0] += (yd - yp + v - 1) / v;
        if (xd - e[w] > 0)
          c[0] += xd - e[w];
        else
          c[0] += e[w] - xd;
      }
      if (b == 0) {
        c[0] = 1000000000;
        c[1] = 1000000000;
      }
      if (xp < s[0] && a != 0) {
        c[2] = 10000000000;
        c[3] = s[0] - xp;
        if (yp - yd > 0)
          c[3] += yp - yd;
        else
          c[3] += yd - yp;
        if (xd - s[0] > 0)
          c[3] += xd - s[0];
        else
          c[3] += s[0] - xd;
      }
      if (xp > s[a - 1] && a != 0) {
        c[2] = 10000000000;
        c[3] = xp - s[a - 1];
        if (yp - yd > 0)
          c[3] += yp - yd;
        else
          c[3] += yd - yp;
        if (xd - s[a - 1] > 0)
          c[3] += xd - s[a - 1];
        else
          c[3] += s[a - 1] - xd;
      }
      if (xp < s[a - 1] && xp > s[0] && a != 0) {
        w = bs(0, a - 1, xp, 0);
        c[3] = xp - s[w];
        if (yp - yd > 0)
          c[3] += yp - yd;
        else
          c[3] += yd - yp;
        if (xd - s[w] > 0)
          c[3] += xd - s[w];
        else
          c[3] += s[w] - xd;
        w++;
        c[2] = s[w] - xp;
        if (yp - yd > 0)
          c[2] += yp - yd;
        else
          c[2] += yd - yp;
        if (xd - s[w] > 0)
          c[2] += xd - s[w];
        else
          c[2] += s[w] - xd;
      }
      if (a == 0) {
        c[2] = 1000000000;
        c[3] = 1000000000;
      }
      if (c[0] <= c[1] && c[0] <= c[2] && c[0] <= c[3])
        printf("%d\n", c[0]);
      else {
        if (c[1] <= c[0] && c[1] <= c[2] && c[1] <= c[3])
          printf("%d\n", c[1]);
        else {
          if (c[2] <= c[1] && c[2] <= c[0] && c[2] <= c[3])
            printf("%d\n", c[2]);
          else {
            if (c[3] <= c[1] && c[3] <= c[2] && c[3] <= c[0])
              printf("%d\n", c[3]);
          }
        }
      }
    }
  }
  return 0;
}
