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>
std::vector<int> al;
std::vector<int> ae;
int binsearch_l_al(int l, int r, int x) {
  while (r - l > 1) {
    int k = (r + l) / 2;
    if (al[k] <= x)
      l = k;
    else
      r = k;
  }
  return l;
}
int binsearch_r_al(int l, int r, int x) {
  while (r - l > 1) {
    int k = (r + l) / 2;
    if (al[k] >= x)
      r = k;
    else
      l = k;
  }
  return r;
}
int binsearch_l_ae(int l, int r, int x) {
  while (r - l > 1) {
    int k = (r + l) / 2;
    if (ae[k] <= x)
      l = k;
    else
      r = k;
  }
  return l;
}
int binsearch_r_ae(int l, int r, int x) {
  while (r - l > 1) {
    int k = (r + l) / 2;
    if (ae[k] >= x)
      r = k;
    else
      l = k;
  }
  return r;
}
int main() {
  int n, m, cl, ce, u;
  std::cin >> n >> m >> cl >> ce >> u;
  al.resize(cl);
  ae.resize(ce);
  for (int& i : al) std::cin >> i;
  for (int& i : ae) std::cin >> i;
  int q;
  std::cin >> q;
  std::vector<int> lst(q);
  for (int i = 0; i < q; i++) {
    int x1, y1, x2, y2;
    std::cin >> x1 >> y1 >> x2 >> y2;
    int mini = 1000000000;
    if (x1 == x2)
      mini = std::abs(y2 - y1);
    else if (y1 >= y2) {
      int l = -1, r = cl + 1;
      int left_l = binsearch_l_al(-1, cl, y1);
      int left_e = binsearch_l_ae(-1, ce, y1);
      int right_l = binsearch_r_al(-1, cl, y2);
      int right_e = binsearch_r_ae(-1, ce, y2);
      if (left_l != -1)
        mini =
            std::min(mini, std::abs(al[left_l] - y1) +
                               std::abs(al[left_l] - y2) + std::abs(x2 - x1));
      if (left_e != -1)
        mini = std::min(mini, std::abs(ae[left_e] - y1) +
                                  std::abs(ae[left_e] - y2) +
                                  (std::abs(x2 - x1) + u - 1) / u);
      if (right_l != cl)
        mini =
            std::min(mini, std::abs(al[right_l] - y1) +
                               std::abs(al[right_l] - y2) + std::abs(x2 - x1));
      if (right_e != ce)
        mini = std::min(mini, std::abs(ae[right_e] - y1) +
                                  std::abs(ae[right_e] - y2) +
                                  (std::abs(x2 - x1) + u - 1) / u);
    } else if (y1 < y2) {
      int l = -1, r = cl + 1;
      int left_l = binsearch_l_al(-1, cl, y2);
      int left_e = binsearch_l_ae(-1, ce, y2);
      int right_l = binsearch_r_al(-1, cl, y1);
      int right_e = binsearch_r_ae(-1, ce, y1);
      if (left_l != -1)
        mini =
            std::min(mini, std::abs(al[left_l] - y1) +
                               std::abs(al[left_l] - y2) + std::abs(x2 - x1));
      if (left_e != -1)
        mini = std::min(mini, std::abs(ae[left_e] - y1) +
                                  std::abs(ae[left_e] - y2) +
                                  (std::abs(x2 - x1) + u - 1) / u);
      if (right_l != cl)
        mini =
            std::min(mini, std::abs(al[right_l] - y1) +
                               std::abs(al[right_l] - y2) + std::abs(x2 - x1));
      if (right_e != ce)
        mini = std::min(mini, std::abs(ae[right_e] - y1) +
                                  std::abs(ae[right_e] - y2) +
                                  (std::abs(x2 - x1) + u - 1) / u);
    }
    lst[i] = mini;
  }
  for (int& x : lst) std::cout << x << std::endl;
}
