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;
int cl[100001];
int ce[100001];
int main() {
  int i, j;
  int n, m, l, e, v;
  scanf("%d%d%d%d%d", &n, &m, &l, &e, &v);
  for (i = 1; i <= l; i++) {
    int temp;
    scanf("%d", &cl[i]);
  }
  for (i = 1; i <= e; i++) {
    int temp;
    scanf("%d", &ce[i]);
  }
  long long q;
  scanf("%lld", &q);
  for (i = 0; i < q; i++) {
    int a = 0, b = 0;
    long long int vl, ve;
    int ll = 0, rr = m + 1;
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (y1 > y2) {
      swap(y1, y2);
      swap(x1, x2);
    }
    for (j = 1; j <= l; j++) {
      if (cl[j] >= y1 && cl[j] <= y2) {
        a = 1;
        break;
      } else if (cl[j] < y1 && cl[j] > ll) {
        a = 2;
        ll = cl[j];
      } else if (cl[j] > y2 && cl[j] < rr) {
        a = 2;
        rr = cl[j];
        break;
      }
    }
    if (a == 1) {
      vl = y2 - y1 + abs(x2 - x1);
    } else if (a == 0) {
      vl = 2 * n + 2 * m;
    } else if (a == 2) {
      int gap = y1 - ll;
      if (y1 - ll > rr - y2) {
        gap = rr - y2;
      }
      vl = y2 - y1 + abs(x2 - x1) + gap * 2;
    }
    int sum = 0;
    int t = abs(x2 - x1);
    if (t > 0) {
      sum = t / v;
      if (t % v != 0) {
        sum++;
      }
    }
    ll = 0, rr = m + 1;
    for (j = 1; j <= e; j++) {
      if (ce[j] >= y1 && ce[j] <= y2) {
        b = 1;
        break;
      } else if (ce[j] < y1 && ce[j] > ll) {
        b = 2;
        ll = ce[j];
      } else if (ce[j] > y2 && ce[j] < rr) {
        b = 2;
        rr = ce[j];
        break;
      }
    }
    if (b == 1) {
      ve = y2 - y1 + sum;
    } else if (b == 0) {
      ve = 2 * n + 2 * m;
    } else if (b == 2) {
      int gap = y1 - ll;
      if (y1 - ll > rr - y2) {
        gap = rr - y2;
      }
      ve = y2 - y1 + sum + gap * 2;
    }
    if (vl > ve) {
      swap(vl, ve);
    }
    printf("%lld\n", vl);
  }
  return 0;
}
