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;
#pragma GCC optimize("-O2")
int n, m, cl, ce, v, q, x1, x2, ya, y2, ans1, ans2;
int S[(int)1e5], E[(int)1e5];
int bsrch(int start, int end, int v[]) {
  int mid, temp, ans = m;
  while (start < end) {
    mid = start + (end - start) / 2;
    temp = v[mid];
    if (temp > ya && temp < y2) {
      return 0;
    }
    if (temp > y2) {
      temp -= y2;
      ans = min(ans, temp);
      if (ans == temp) {
        if (end == mid) return ans;
        end = mid;
        continue;
      } else {
        return ans;
      }
    }
    temp = ya - temp;
    ans = min(ans, temp);
    if (ans == temp) {
      if (start == mid) return ans;
      start = mid;
    } else {
      return ans;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> cl >> ce >> v;
  for (int i = 0; i < cl; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < ce; i++) {
    cin >> E[i];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> x1 >> ans1 >> x2 >> ans2;
    ya = min(ans1, ans2);
    y2 = max(ans1, ans2);
    ans1 = 2 * bsrch(0, cl, S);
    if (cl == 0) ans1 = (int)1e9;
    ans2 = 2 * bsrch(0, ce, E);
    if (ce == 0) ans2 = (int)1e9;
    x2 = abs(x2 - x1);
    if (x2 == 0) {
      cout << y2 - ya << "\n";
      continue;
    }
    ans1 = ans1 + x2 + y2 - ya;
    if (x2 % v == 0)
      ans2 = ans2 + y2 - ya + x2 / v;
    else
      ans2 = ans2 + y2 - ya + x2 / v + 1;
    cout << min(ans1, ans2) << "\n";
  }
  return 0;
}
