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 speed;
int n, m;
int solve(int n, vector<int> &a, int x1, int x2, int y1, int y2,
          bool elevator) {
  int ans = 0;
  if (n == 0) {
    return 1e9;
  }
  if (y1 == y2) {
    return abs(x1 - x2);
  }
  int v = speed;
  if (elevator)
    ans += (abs(y1 - y2) + v - 1) / v + abs(x1 - x2);
  else
    ans += abs(y1 - y2) + abs(x1 - x2);
  auto itr = upper_bound(a.begin(), a.end(), x1);
  int j;
  if (itr != a.end())
    j = *itr;
  else
    j = m;
  int i = -1;
  if (itr != a.begin()) {
    itr--;
    i = *itr;
  }
  if (j == m)
    ans += 2 * abs(x1 - i);
  else if (j < x2)
    ans += 0;
  else if (j > x2) {
    int d1 = 1000000000, d2 = abs(j - x2);
    if (i != -1) d1 = abs(i - x1);
    ans += 2 * min(d1, d2);
  }
  return ans;
}
int main() {
  int stairs, eles;
  scanf("%d %d %d %d %d", &n, &m, &stairs, &eles, &speed);
  vector<int> pos_st, pos_el;
  for (int i = 0; i < stairs; i++) {
    int x;
    scanf("%d", &x);
    --x;
    pos_st.push_back(x);
  }
  for (int i = 0; i < eles; i++) {
    int x;
    scanf("%d", &x);
    --x;
    pos_el.push_back(x);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    --x1;
    --x2;
    --y1;
    --y2;
    if (y1 > y2) {
      swap(x1, x2);
      swap(y1, y2);
    }
    printf("%d\n", min(solve(stairs, pos_st, y1, y2, x1, x2, 0),
                       solve(eles, pos_el, y1, y2, x1, x2, 1)));
  }
  return 0;
}
