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 pos_f[100005];
int pos_e[100005];
int main() {
  int n, m, num_f, num_e, v;
  cin >> n >> m >> num_f >> num_e >> v;
  for (int i = 0; i < num_f; i++) {
    scanf("%d", &pos_f[i]);
  }
  for (int i = 0; i < num_e; i++) {
    scanf("%d", &pos_e[i]);
  }
  int num_q;
  cin >> num_q;
  for (int i = 0; i < num_q; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    int min_time = 1e9;
    ;
    int num_mi = min(y1, y2);
    if (num_f) {
      if (pos_f[num_f - 1] < num_mi) {
        int now_time = abs(pos_f[num_f - 1] - y1) + abs(pos_f[num_f - 1] - y2) +
                       abs(x1 - x2);
        min_time = min(min_time, now_time);
      } else {
        int pos = lower_bound(pos_f, pos_f + num_f, num_mi) - pos_f;
        int now_time =
            abs(pos_f[pos] - y1) + abs(pos_f[pos] - y2) + abs(x1 - x2);
        min_time = min(min_time, now_time);
        if (pos) {
          now_time = abs(pos_f[pos - 1] - y1) + abs(pos_f[pos - 1] - y2) +
                     abs(x1 - x2);
          min_time = min(min_time, now_time);
        }
      }
    }
    if (num_e) {
      if (pos_e[num_e - 1] < num_mi) {
        int now_time = abs(pos_e[num_e - 1] - y1) + abs(pos_e[num_e - 1] - y2) +
                       abs(x1 - x2) / v + (abs(x1 - x2) % v != 0);
        min_time = min(min_time, now_time);
      } else {
        int pos = lower_bound(pos_e, pos_e + num_e, num_mi) - pos_e;
        int now_time = abs(pos_e[pos] - y1) + abs(pos_e[pos] - y2) +
                       abs(x1 - x2) / v + (abs(x1 - x2) % v != 0);
        min_time = min(min_time, now_time);
        if (pos) {
          now_time = abs(pos_e[pos - 1] - y1) + abs(pos_e[pos - 1] - y2) +
                     abs(x1 - x2) / v + (abs(x1 - x2) % v != 0);
          min_time = min(min_time, now_time);
        }
      }
    }
    cout << min_time << endl;
  }
  return 0;
}
