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 inf = 2e9;
vector<int> lifts;
vector<int> lads;
int use(int x1, int y1, int x2, int y2, int pos, int s) {
  int res = abs(y1 - pos) + abs(y2 - pos);
  int deltax = abs(x1 - x2);
  res += deltax / s;
  if (deltax % s != 0) res++;
  return res;
}
int speed;
int get(int x1, int y1, int x2, int y2) {
  int res = x1 == x2 ? abs(y1 - y2) : inf;
  int pos = lower_bound(lads.begin(), lads.end(), y1) - lads.begin();
  if (pos < (int)lads.size()) res = min(res, use(x1, y1, x2, y2, lads[pos], 1));
  pos--;
  if (pos >= 0) res = min(res, use(x1, y1, x2, y2, lads[pos], 1));
  pos = lower_bound(lifts.begin(), lifts.end(), y1) - lifts.begin();
  if (pos < (int)lifts.size())
    res = min(res, use(x1, y1, x2, y2, lifts[pos], speed));
  pos--;
  if (pos >= 0) res = min(res, use(x1, y1, x2, y2, lifts[pos], speed));
  return res;
}
int main() {
  int floors, len, lad_num, lift_num;
  scanf("%d%d", &floors, &len);
  scanf("%d%d%d", &lad_num, &lift_num, &speed);
  lads.resize(lad_num);
  for (int i = 0; i < (int)lad_num; i++) scanf("%d", &lads[i]);
  lifts.resize(lift_num);
  for (int i = 0; i < (int)lift_num; i++) scanf("%d", &lifts[i]);
  int Q;
  scanf("%d", &Q);
  for (int q = 0; q < (int)Q; q++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    int first = get(x1, y1, x2, y2);
    int second = get(x2, y2, x1, y1);
    int ans = min(first, second);
    printf("%d\n", ans);
  }
}
