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;
vector<long long int> star, lift;
int main() {
  long long int n, m, cl, ce, v, q, i, j;
  scanf("%I64d %I64d %I64d %I64d %I64d", &n, &m, &cl, &ce, &v);
  for (i = 1; i <= cl; i++) {
    long long int x;
    scanf("%I64d", &x);
    star.push_back(x);
  }
  for (i = 1; i <= ce; i++) {
    long long int x;
    scanf("%I64d", &x);
    lift.push_back(x);
  }
  scanf("%I64d", &q);
  for (i = 1; i <= q; i++) {
    long long int x1, x2, y1, y2, ans = 1e18;
    scanf("%I64d %I64d %I64d %I64d", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      ans = y1 - y2;
      if (ans < 0) ans = -ans;
    } else {
      if (x1 > x2) {
        swap(x1, x2);
        swap(y1, y2);
      }
      long long int ele1 = 1e18, ele2 = 1e18, str1 = 1e18, str2 = 1e18;
      if (lift.size()) {
        long long int lo =
            lower_bound(lift.begin(), lift.end(), y1) - lift.begin();
        if (lo == lift.size()) lo--;
        long long int temp = lift[lo] - y1;
        if (temp < 0) temp = -temp;
        temp += (x2 - x1) / v;
        if ((x2 - x1) % v) temp++;
        long long int p = y2 - lift[lo];
        if (p < 0) p = -p;
        temp += p;
        ele1 = temp, temp = 0;
        long long int up =
            upper_bound(lift.begin(), lift.end(), y1) - lift.begin();
        if (up == lift.size()) up--;
        temp = lift[up] - y1;
        if (temp < 0) temp = -temp;
        temp += (x2 - x1) / v;
        if ((x2 - x1) % v) temp++;
        p = y2 - lift[up];
        if (p < 0) p = -p;
        temp += p;
        ele2 = temp;
      }
      if (star.size()) {
        long long int lo =
            lower_bound(star.begin(), star.end(), y1) - star.begin();
        if (lo == star.size()) lo--;
        long long int val = y1 - star[lo];
        if (val < 0) val = -val;
        val += (x2 - x1);
        long long int p = star[lo] - y2;
        if (p < 0) p = -p;
        val += p;
        str1 = val;
        long long int up =
            upper_bound(star.begin(), star.end(), y1) - star.begin();
        if (up == star.size()) up--;
        val = y1 - star[up];
        if (val < 0) val = -val;
        val += (x2 - x1);
        p = star[up] - y2;
        if (p < 0) p = -p;
        val += p;
        str2 = val;
      }
      ans = min(ans, min(ele1, ele2));
      ans = min(ans, min(str1, str2));
    }
    printf("%I64d\n", ans);
  }
}
