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;
bool pr[1000007];
void sieve() {
  pr[0] = 1;
  pr[1] = 1;
  for (long long i = 2; i * i < (1000007); i++) {
    for (long long j = 2 * i; j <= 1000007; j += i) {
      pr[j] = 1;
    }
  }
}
long long fpow(long long x, long long y) {
  x = x % 1000000007;
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x;
    res %= 1000000007;
    y = y >> 1;
    x = x * x;
    x %= 1000000007;
  }
  return res;
}
long long sta[100007], ele[100007];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, cl, ce, v, x;
  cin >> n >> m >> cl >> ce >> v;
  for (long long i = 0; i < 100003; i++) {
    sta[i] = 9999999;
    ele[i] = 9999999;
  }
  for (long long i = 0; i < cl; i++) {
    cin >> x;
    sta[i] = x;
  }
  for (long long i = 0; i < ce; i++) {
    cin >> x;
    ele[i] = x;
  }
  long long q;
  cin >> q;
  while (q--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y2 - y1) << "\n";
      continue;
    }
    long long st1 = upper_bound(sta, sta + cl, y1) - sta, anst1 = 0;
    anst1 += abs(y1 - sta[st1]);
    anst1 += abs(x2 - x1);
    anst1 += abs(y2 - sta[st1]);
    long long st = lower_bound(sta, sta + cl, y1 - 1) - sta, anst = 0;
    if (anst1 >= 9999999) {
    } else
      st -= 1;
    anst += abs(y1 - sta[st]);
    anst += abs(x2 - x1);
    anst += abs(y2 - sta[st]);
    long long el = lower_bound(ele, ele + ce, y1) - ele, anse = 0;
    el -= 1;
    el = ele[el];
    anse += abs(y1 - el);
    anse += ceil(long double(long double(abs(x2 - x1)) / (long double)v));
    anse += abs(y2 - el);
    long long el1 = upper_bound(ele, ele + ce, y1) - ele, anse1 = 0;
    el1 = ele[el1];
    anse1 += abs(y1 - el1);
    anse1 += ceil(long double(long double(abs(x2 - x1)) / (long double)v));
    anse1 += abs(y2 - el1);
    if (anse1 >= 99999999) {
      el++;
      el = ele[el];
      anse += abs(y1 - el);
      anse += ceil(long double(long double(abs(x2 - x1)) / (long double)v));
      anse += abs(y2 - el);
    }
    anse = min(anse, anse1);
    anst = min(anst, anst1);
    cout << min(anse, anst) << "\n";
  }
}
