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;
template <class T>
inline bool chkmin(T& x, T y) {
  return x > y ? x = y, true : false;
}
template <class T>
inline bool chkmax(T& x, T y) {
  return x < y ? x = y, true : false;
}
inline long long read(void) {
  long long x, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (x = 0; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
int n, m, cs, ce, v, q, x1, x2, y11, y2;
set<int> l, e;
int main(void) {
  n = read();
  m = read();
  cs = read();
  ce = read();
  v = read();
  for (int i = (1); i <= (cs); ++i) l.insert(read());
  for (int i = (1); i <= (ce); ++i) e.insert(read());
  q = read();
  while (q--) {
    x1 = read();
    y11 = read();
    x2 = read();
    y2 = read();
    if (x1 == x2) {
      printf("%d\n", abs(y2 - y11));
      continue;
    }
    if (x1 > x2) swap(x1, x2);
    if (y11 > y2) swap(y11, y2);
    int ans = 2e9;
    do {
      if (!l.size()) break;
      {
        auto gg = l.lower_bound(y11);
        if (gg == l.end()) gg--;
        chkmin(ans, abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1));
        ;
        if (gg != l.begin())
          gg--, chkmin(ans, abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1));
        ;
      }
      {
        auto gg = l.lower_bound(y2);
        if (gg == l.end()) gg--;
        chkmin(ans, abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1));
        ;
        if (gg != l.begin())
          gg--, chkmin(ans, abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1));
        ;
      }
    } while (0);
    do {
      if (!e.size()) break;
      {
        auto gg = e.lower_bound(y11);
        if (gg == e.end()) gg--;
        chkmin(ans, abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1 + v - 1) / v);
        ;
        if (gg != e.begin())
          gg--, chkmin(ans,
                       abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1 + v - 1) / v);
        ;
      }
      {
        auto gg = e.lower_bound(y2);
        if (gg == e.end()) gg--;
        chkmin(ans, abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1 + v - 1) / v);
        ;
        if (gg != e.begin())
          gg--, chkmin(ans,
                       abs(y11 - *gg) + abs(y2 - *gg) + (x2 - x1 + v - 1) / v);
        ;
      }
    } while (0);
    printf("%d\n", ans);
  }
  return 0;
}
