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 stair[100010];
int elevator[100010];
int compare(const void *a, const void *b) {
  int c = *(int *)a;
  int d = *(int *)b;
  return (c - d);
}
int bestelevator(int y1, int y2, int zzz[], int ce1, int ce2) {
  if (ce1 == ce2) {
    if (zzz[ce1] >= y1 && zzz[ce1] <= y2) {
      return 0;
    } else {
      int a = abs(zzz[ce1] - y1);
      int b = abs(zzz[ce1] - y2);
      if (a > b)
        return b;
      else {
        return a;
      }
    }
  }
  if (ce1 + 1 == ce2) {
    if (zzz[ce1] >= y1 && zzz[ce1] <= y2) {
      return 0;
    }
    if (zzz[ce2] >= y1 && zzz[ce2] <= y2) {
      return 0;
    }
    int a = zzz[ce1] - y1;
    int b = zzz[ce2] - y2;
    if (a > b)
      return b;
    else {
      return a;
    }
  }
  if (zzz[(ce1 + ce2) / 2] >= y1 && zzz[(ce1 + ce2) / 2] <= y2) {
    return 0;
  } else if (zzz[(ce1 + ce2) / 2] < y1) {
    return bestelevator(y1, y2, zzz, (ce1 + ce2) / 2, ce2);
  } else {
    return bestelevator(y1, y2, zzz, ce1, (ce1 + ce2) / 2);
  }
}
int main() {
  int n, m, cl, ce, v;
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 0; i < cl; ++i) {
    scanf("%d", &stair[i]);
  }
  for (int i = 0; i < ce; ++i) {
    scanf("%d", &elevator[i]);
  }
  qsort(stair, cl, 4, compare);
  qsort(elevator, ce, 4, compare);
  int q;
  scanf("%d", &q);
  int x1, y1, x2, y2;
  for (int i = 0; i < q; ++i) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int ans = 2000000000;
    int ans2 = 2000000000;
    if (ce > 0) {
      int g = bestelevator(y1, y2, elevator, 0, ce - 1);
      if ((x2 - x1) % v == 0) {
        ans = y2 - y1 + ((x2 - x1) / v);
      } else {
        ans = y2 - y1 + ((x2 - x1) / v) + 1;
      }
      ans = ans + g * 2;
    }
    if (cl > 0) {
      int h = bestelevator(y1, y2, stair, 0, cl - 1);
      ans2 = y2 - y1 + h + h + x2 - x1;
    }
    if (ans < ans2) {
      printf("%d\n", ans);
    } else {
      printf("%d\n", ans2);
    }
  }
  return 0;
}
