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 max_n = 101111, inf = 1000111222;
int n, m, v[2], q;
int cnt[2], a[2][max_n];
int get(int x1, int y1, int x2, int y2, int y, int v) {
  if (y == -1 || y == inf) {
    return inf;
  }
  int res = abs(y1 - y) + abs(y2 - y) + (abs(x1 - x2) + v - 1) / v;
  return res;
}
int main() {
  scanf("%d%d%d%d%d", &n, &m, &cnt[0], &cnt[1], &v[1]);
  v[0] = 1;
  for (int i = 0; i < 2; ++i) {
    for (int j = 1; j <= cnt[i]; ++j) {
      scanf("%d", &a[i][j]);
    }
    a[i][0] = -1;
    a[i][cnt[i] + 1] = inf;
  }
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    --x1;
    --x2;
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    int ans = inf;
    for (int tp = 0; tp < 2; ++tp) {
      if (cnt[tp]) {
        int pos = lower_bound(a[tp], a[tp] + cnt[tp] + 2, y1) - a[tp];
        ans = min(ans, get(x1, y1, x2, y2, a[tp][pos], v[tp]));
        ans = min(ans, get(x1, y1, x2, y2, a[tp][pos - 1], v[tp]));
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
