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;
int main(int argc, char const *argv[]) {
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  int l[100001];
  int e[100001];
  for (int i = 0; i < cl; ++i) {
    cin >> l[i];
  }
  for (int i = 0; i < ce; ++i) {
    cin >> e[i];
  }
  int q;
  cin >> q;
  long long x1, y1, x2, y2;
  for (int i = 0; i < q; ++i) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    if (y1 > y2) {
      int temp = x1;
      x1 = x2;
      x2 = temp;
      temp = y1;
      y1 = y2;
      y2 = temp;
    }
    int p;
    int min = 0x3f3f3f3f;
    int yl = -1, yr = 0x3f3f3f3f;
    if (cl > 0) {
      if (y1 <= l[0]) {
        p = l[0];
      } else {
        p = -1;
        int left = 0;
        int right = cl - 1;
        int flag;
        while (true) {
          if (left == right) {
            p = l[left];
            break;
          }
          flag = (left + right) / 2;
          if (l[flag] == y1) {
            p = y1;
            break;
          } else if (l[flag] < y1) {
            if (l[flag + 1] > y1) {
              yl = l[flag];
              yr = l[flag + 1];
              break;
            } else {
              left = flag + 1;
            }
          } else {
            if (l[flag - 1] < y1) {
              yl = l[flag - 1];
              yr = l[flag];
              break;
            } else {
              right = flag - 1;
            }
          }
        }
        if (p == -1) {
          if (yr <= y2) {
            p = yr;
          } else {
            if (yr - y2 > y1 - yl) {
              p = yl;
            } else {
              p = yr;
            }
          }
        }
      }
      min = abs(y1 - p) + abs(x1 - x2) + abs(y2 - p);
    }
    yl = -1, yr = 0x3f3f3f3f;
    if (ce > 0) {
      if (y1 <= e[0]) {
        p = e[0];
      } else {
        p = -1;
        int left = 0;
        int right = ce - 1;
        int flag;
        while (true) {
          if (left == right) {
            p = e[left];
            break;
          }
          flag = (left + right) / 2;
          if (e[flag] == y1) {
            p = y1;
            break;
          } else if (e[flag] < y1) {
            if (e[flag + 1] > y1) {
              yl = e[flag];
              yr = e[flag + 1];
              break;
            } else {
              left = flag + 1;
            }
          } else {
            if (e[flag - 1] < y1) {
              yl = e[flag - 1];
              yr = e[flag];
              break;
            } else {
              right = flag - 1;
            }
          }
        }
        if (p == -1) {
          if (yr <= y2) {
            p = yr;
          } else {
            if (yr - y2 > y1 - yl) {
              p = yl;
            } else {
              p = yr;
            }
          }
        }
      }
      int r = abs(y1 - p) + abs(x1 - x2) / v + abs(y2 - p);
      if (abs(x1 - x2) % v > 0) {
        r++;
      }
      if (r < min) {
        min = r;
      }
    }
    cout << min << endl;
  }
  return 0;
}
