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<int> l;
vector<int> e;
int cl;
int ce;
int fl(int ind) {
  int le = 0;
  int r = cl;
  int m = (le + r) / 2;
  while ((r - le) > 1) {
    if (l[m] > ind)
      r = m;
    else
      le = m;
    m = (le + r) / 2;
  }
  return r;
}
int fe(int ind) {
  int l = 0;
  int r = ce;
  int m = (l + r) / 2;
  while ((r - l) > 1) {
    if (e[m] > ind)
      r = m;
    else
      l = m;
    m = (l + r) / 2;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  int m;
  int u;
  cin >> n >> m >> cl >> ce >> u;
  l.resize(cl);
  e.resize(ce);
  if (cl != 0)
    for (int& i : l) {
      cin >> i;
      i--;
    }
  if (ce != 0)
    for (int& i : e) {
      cin >> i;
      i--;
    }
  int q;
  cin >> q;
  for (int w = 0; w < q; w++) {
    int i1, j1, i2, j2;
    cin >> i1 >> j1 >> i2 >> j2;
    i1--;
    j1--;
    j2--;
    i2--;
    int near_l;
    int near_e;
    if (i1 == i2) {
      cout << abs(j1 - j2) << '\n';
    }
    if (cl != 0 && ce != 0) {
      bool f1, f2, f3, f4;
      f1 = 0;
      f2 = 0;
      f3 = 0;
      f4 = 0;
      if (j1 <= l[0] or j2 <= l[0]) {
        near_l = l[0];
        f1 = 1;
      }
      if (j1 >= l[l.size() - 1] or j2 >= l[l.size() - 1]) {
        near_l = l[l.size() - 1];
        f2 = 1;
      }
      if (j1 <= e[0] or j2 <= e[0]) {
        near_e = e[0];
        f3 = 1;
      }
      if (j1 >= e[e.size() - 1] or j2 >= e[e.size() - 1]) {
        near_e = e[e.size() - 1];
        f4 = 1;
      }
      if (!((f1 or f2) and (f3 or f4))) {
        int v1l = fl(min(j1, j2));
        int v2l = v1l - 1;
        int v3l = fl(max(j1, j2));
        int g1 = abs(l[v1l] - j1) + abs(l[v1l] - j2);
        int g2 = abs(l[v2l] - j1) + abs(l[v2l] - j2);
        int g3 = abs(l[v3l] - j1) + abs(l[v3l] - j2);
        if (g1 <= g2 && g1 <= g3) near_l = l[v1l];
        if (g2 <= g1 && g2 <= g3) near_l = l[v2l];
        if (g3 <= g1 && g3 <= g2) near_l = l[v3l];
        v1l = fe(min(j1, j2));
        v2l = v1l - 1;
        v3l = fe(max(j1, j2));
        g1 = abs(e[v1l] - j1) + abs(e[v1l] - j2);
        g2 = abs(e[v2l] - j1) + abs(e[v2l] - j2);
        g3 = abs(e[v3l] - j1) + abs(e[v3l] - j2);
        if (g1 <= g2 && g1 <= g3) near_e = e[v1l];
        if (g2 <= g1 && g2 <= g3) near_e = e[v2l];
        if (g3 <= g1 && g3 <= g2) near_e = e[v3l];
      }
      int go_vert_e = abs(i2 - i1) / u + (abs(i2 - i1) % u != 0);
      int go_vert_l = abs(i1 - i2);
      int go_gor_e = abs(j1 - near_e) + abs(j2 - near_e);
      int go_gor_l = abs(j1 - near_l) + abs(j2 - near_l);
      cout << min(go_gor_e + go_vert_e, go_gor_l + go_vert_l) << '\n';
    }
    if (cl == 0) {
      bool f1, f2;
      f1 = 0;
      f2 = 0;
      if (j1 <= e[0] or j2 <= e[0]) {
        near_e = e[0];
        f1 = 1;
      }
      if (j1 >= e[e.size() - 1] or j2 >= e[e.size() - 1]) {
        near_e = e[e.size() - 1];
        f2 = 1;
      }
      if (!(f1 or f2)) {
        int v1l = fe(min(j1, j2));
        int v2l = v1l - 1;
        int v3l = fe(max(j1, j2));
        int g1 = abs(e[v1l] - j1) + abs(e[v1l] - j2);
        int g2 = abs(e[v2l] - j1) + abs(e[v2l] - j2);
        int g3 = abs(e[v3l] - j1) + abs(e[v3l] - j2);
        if (g1 <= g2 && g1 <= g3) near_e = e[v1l];
        if (g2 <= g1 && g2 <= g3) near_e = e[v2l];
        if (g3 <= g1 && g3 <= g2) near_e = e[v3l];
      }
      int go_vert_e = abs(i1 - i2) / u + (abs(i2 - i1) % u != 0);
      int go_gor_e = abs(j1 - near_e) + abs(j2 - near_e);
      cout << go_gor_e + go_vert_e << '\n';
    }
    if (ce == 0) {
      bool f1, f2;
      f1 = 0;
      f2 = 0;
      if (j1 <= l[0] or j2 <= l[0]) {
        near_l = l[0];
        f1 = 1;
      }
      if (j1 >= l[l.size() - 1] or j2 >= l[l.size() - 1]) {
        near_l = l[l.size() - 1];
        f2 = 1;
      }
      if (!(f1 or f2)) {
        int v1l = fl(min(j1, j2));
        int v2l = v1l - 1;
        int v3l = fl(max(j1, j2));
        int g1 = abs(l[v1l] - j1) + abs(l[v1l] - j2);
        int g2 = abs(l[v2l] - j1) + abs(l[v2l] - j2);
        int g3 = abs(l[v3l] - j1) + abs(l[v3l] - j2);
        if (g1 <= g2 && g1 <= g3) near_l = l[v1l];
        if (g2 <= g1 && g2 <= g3) near_l = l[v2l];
        if (g3 <= g1 && g3 <= g2) near_l = l[v3l];
      }
      int go_vert_l = abs(i2 - i1);
      int go_gor_l = abs(j1 - near_l) + abs(j2 - near_l);
      cout << go_gor_l + go_vert_l << '\n';
    }
  }
  return 0;
}
