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 sta[100010], ele[100010];
int get_sta(int l, int r, int goal) {
  while (l < r) {
    int mid = (l + r) / 2;
    if (sta[mid] >= goal)
      r = mid;
    else
      l = mid + 1;
  }
  return r;
}
int get_ele(int l, int r, int goal) {
  while (l < r) {
    int mid = (l + r) / 2;
    if (ele[mid] >= goal)
      r = mid;
    else
      l = mid + 1;
  }
  return r;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m, ss, ee, speed, i, j;
  cin >> n >> m >> ss >> ee >> speed;
  int pre = 1;
  for (i = 0; i < ss; i++) cin >> sta[i];
  for (i = 0; i < ee; i++) cin >> ele[i];
  int q, use, use_index;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int time = 1e9;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    use_index = get_sta(0, ss, y1);
    if (use_index != ss) {
      use = sta[use_index];
      int newtime = abs(use - y1) + abs(x2 - x1) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    if (use_index != 0) {
      use = sta[use_index - 1];
      int newtime = abs(use - y1) + abs(x2 - x1) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    use_index = get_sta(0, ss, y2);
    if (use_index != ss) {
      use = sta[use_index];
      int newtime = abs(use - y1) + abs(x2 - x1) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    if (use_index != 0) {
      use = sta[use_index - 1];
      int newtime = abs(use - y1) + abs(x2 - x1) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    use_index = get_ele(0, ee, y1);
    if (use_index != ee) {
      use = ele[use_index];
      int newtime =
          abs(use - y1) + ceil((float)abs(x2 - x1) / speed) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    if (use_index != 0) {
      use = ele[use_index - 1];
      int newtime =
          abs(use - y1) + ceil((float)abs(x2 - x1) / speed) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    use_index = get_ele(0, ee, y2);
    if (use_index != ee) {
      use = ele[use_index];
      int newtime =
          abs(use - y1) + ceil((float)abs(x2 - x1) / speed) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    if (use_index != 0) {
      use = ele[use_index - 1];
      int newtime =
          abs(use - y1) + ceil((float)abs(x2 - x1) / speed) + abs(y2 - use);
      if (newtime < time) time = newtime;
    }
    cout << time << endl;
  }
  return 0;
}
