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 = 2e5 + 1000;
int flo[maxn], el[maxn];
int main() {
  int m, n, cl, ce, v;
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 1; i <= cl; i++) {
    scanf("%d", &flo[i]);
  }
  for (int i = 1; i <= ce; i++) {
    scanf("%d", &el[i]);
  }
  int q;
  scanf("%d", &q);
  int x1, x2, y1, y2;
  while (q--) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 != x2) {
      if (y1 > y2) swap(y1, y2);
      int ans1 = 0, ans2 = 0;
      if (cl != 0 && ce != 0) {
        int pos1 = lower_bound(flo + 1, flo + cl + 1, y1) - flo;
        if (pos1 != cl + 1 && flo[pos1] <= y2) {
          ans1 = y2 - y1 + fabs(x1 - x2);
        } else {
          int d1;
          if (pos1 != cl + 1) {
            d1 = min(fabs(flo[pos1] - y1), fabs(flo[pos1 - 1] - y1));
          } else
            d1 = y1 - flo[pos1 - 1];
          int pos2 = lower_bound(flo + 1, flo + cl + 1, y2) - flo;
          int d2;
          if (pos2 != cl + 1) {
            d2 = min(flo[pos2] - y2, y2 - flo[pos2 - 1]);
          } else
            d2 = y2 - flo[pos2 - 1];
          if (d1 < d2) {
            ans1 = y2 - y1 + 2 * d1 + fabs(x1 - x2);
          } else
            ans1 = y2 - y1 + 2 * d2 + fabs(x1 - x2);
        }
        int pos3 = lower_bound(el + 1, el + ce + 1, y1) - el;
        int pos4 = lower_bound(el + 1, el + ce + 1, y2) - el;
        if (pos3 != ce + 1 && el[pos3] <= y2) {
          ans2 = y2 - y1 + (v - 1 + fabs(x1 - x2)) / v;
        } else {
          int d1, d2;
          if (pos3 != ce + 1)
            d1 = min(el[pos3] - y1, y1 - el[pos3 - 1]);
          else
            d1 = y1 - el[pos3 - 1];
          if (pos4 != ce + 1)
            d2 = min(el[pos4] - y2, y2 - el[pos4 - 1]);
          else
            d2 = y2 - el[pos4 - 1];
          if (d1 < d2)
            ans2 = y2 - y1 + (v - 1 + fabs(x1 - x2)) / v + 2 * d1;
          else
            ans2 = y2 - y1 + (v - 1 + fabs(x1 - x2)) / v + 2 * d2;
        }
        printf("%d\n", min(ans1, ans2));
      } else if (cl == 0) {
        int pos3 = lower_bound(el + 1, el + ce + 1, y1) - el;
        int pos4 = lower_bound(el + 1, el + ce + 1, y2) - el;
        if (pos3 != ce + 1 && el[pos3] <= y2) {
          ans2 = y2 - y1 + (v - 1 + fabs(x1 - x2)) / v;
        } else {
          int d1, d2;
          if (pos3 != ce + 1)
            d1 = min(el[pos3] - y1, y1 - el[pos3 - 1]);
          else
            d1 = y1 - el[pos3 - 1];
          if (pos4 != ce + 1)
            d2 = min(el[pos4] - y2, y2 - el[pos4 - 1]);
          else
            d2 = y2 - el[pos4 - 1];
          if (d1 < d2)
            ans2 = y2 - y1 + (v - 1 + fabs(x1 - x2)) / v + 2 * d1;
          else
            ans2 = y2 - y1 + (v - 1 + fabs(x1 - x2)) / v + 2 * d2;
        }
        printf("%d\n", ans2);
      } else {
        int pos1 = lower_bound(flo + 1, flo + cl + 1, y1) - flo;
        if (pos1 != cl + 1 && flo[pos1] <= y2) {
          ans1 = y2 - y1 + fabs(x1 - x2);
        } else {
          int d1;
          if (pos1 != cl + 1) {
            d1 = min(fabs(flo[pos1] - y1), fabs(flo[pos1 - 1] - y1));
          } else
            d1 = y1 - flo[pos1 - 1];
          int pos2 = lower_bound(flo + 1, flo + cl + 1, y2) - flo;
          int d2;
          if (pos2 != cl + 1) {
            d2 = min(flo[pos2] - y2, y2 - flo[pos2 - 1]);
          } else
            d2 = y2 - flo[pos2 - 1];
          if (d1 < d2) {
            ans1 = y2 - y1 + 2 * d1 + fabs(x1 - x2);
          } else
            ans1 = y2 - y1 + 2 * d2 + fabs(x1 - x2);
        }
        printf("%d\n", ans1);
      }
    } else {
      int z = fabs(y1 - y2);
      printf("%d\n", z);
    }
  }
}
