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>
static int stairs[100000], elevators[100000];
static int n, m, cs, ce, v, q, i, line1, line2, col1, col2;
static void swap(int *a, int *b) {
  int aux = *a;
  *a = *b;
  *b = aux;
}
static int min(int a, int b) {
  if (a < b) return a;
  return b;
}
static int bs_in(int arr[], int c, int start, int end) {
  int mid, pos;
  for (mid = 1; mid < c; mid <<= 1)
    ;
  for (pos = 0; mid; mid >>= 1) {
    if (pos + mid < c && arr[pos + mid] < end) {
      pos += mid;
    }
    if (arr[pos] < end && arr[pos] > start) {
      return pos;
    }
  }
  return -1;
}
static int bs_left(int arr[], int c, int x) {
  int mid, pos;
  for (mid = 1; mid < c; mid <<= 1)
    ;
  for (pos = 0; mid; mid >>= 1) {
    if (pos + mid < c && arr[pos + mid] < x) {
      pos += mid;
    }
  }
  if (arr[pos] < x) return pos;
  return -1;
}
static int bs_right(int arr[], int c, int x) {
  int mid, pos;
  for (mid = 1; mid < c; mid <<= 1)
    ;
  for (pos = c - 1; mid; mid >>= 1) {
    if (pos - mid >= 0 && arr[pos + mid] > x) {
      pos -= mid;
    }
  }
  if (arr[pos] > x) return pos;
  return -1;
}
int main(void) {
  int ein, sin, eleft, sleft, eright, sright, d1, d2, d3, d4, d5;
  scanf("%d %d %d %d %d", &n, &m, &cs, &ce, &v);
  for (i = 0; i < cs; i++) {
    scanf("%d", &stairs[i]);
  }
  for (i = 0; i < ce; i++) {
    scanf("%d", &elevators[i]);
  }
  scanf("%d", &q);
  for (i = 0; i < q; i++) {
    scanf("%d %d %d %d", &line1, &col1, &line2, &col2);
    if (col1 > col2) {
      swap(&col1, &col2);
    }
    if (line1 > line2) {
      swap(&line1, &line2);
    }
    if ((ein = bs_in(elevators, ce, col1, col2)) != -1) {
      printf("%d\n",
             col2 - col1 + (line2 - line1) / v + ((line2 - line1) % v != 0));
    } else {
      sin = bs_in(stairs, cs, col1, col2);
      eleft = bs_left(elevators, ce, col1);
      sleft = bs_left(stairs, cs, col1);
      eright = bs_right(elevators, ce, col2);
      sright = bs_right(stairs, cs, col2);
      d1 = d2 = d3 = d4 = d5 = INT_MAX;
      if (sin != -1) {
        d1 = 1 + col2 - col1 + (line2 - line1);
      }
      if (eleft != -1) {
        d2 = col1 - elevators[eleft] + col2 - elevators[eleft] +
             (line2 - line1) / v + ((line2 - line1) % v != 0);
      }
      if (sleft != -1) {
        d3 = col1 - stairs[sleft] + col2 - stairs[sleft] + (line2 - line1);
      }
      if (eright != -1) {
        d4 = elevators[eright] - col1 + elevators[eright] - col2 +
             (line2 - line1) / v + ((line2 - line1) % v != 0);
      }
      if (sright != -1) {
        d5 = stairs[sright] - col1 + stairs[sright] - col2 + (line2 - line1);
      }
      printf("%d\n", min(d1, min(d2, min(d3, min(d4, d5)))));
    }
  }
  return 0;
}
