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;
long long dif_part(long long y1, long long y2) { return abs(y1 - y2); }
long long dif_l(long long x1, long long x2) { return abs(x1 - x2); }
long long dif_c(long long x1, long long x2, long long vc) {
  return (abs(x1 - x2) + 1) / (vc - 1);
}
long long in_floor(long long x1, long long x2) { return x1 == x2; }
int main() {
  long long n, m, l, c, vc, t;
  cin >> n >> m >> l >> c >> vc;
  long long a[n + 1][m + 1];
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) a[i][j] = 0;
  for (long long i = 0; i < l; i++) {
    cin >> t;
    for (long long j = 1; j <= n; j++) a[j][t] = -1;
  }
  for (long long i = 0; i < l; i++) {
    cin >> t;
    for (long long j = 1; j <= n; j++) a[j][t] = 1;
  }
  long long q, x1, y1, x2, y2;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (in_floor(x1, x2)) {
      cout << dif_part(y1, y2) << "\n";
    } else {
      long long min_sl = 999999999999999999;
      for (long long j = 1; j <= m; j++)
        if (a[x1][j] != 0) {
          long long sl;
          if (a[x1][j] == -1)
            sl = dif_part(j, y1) + dif_l(x1, x2) + dif_part(j, y2);
          else
            sl = dif_part(j, y1) + dif_c(x1, x2, vc) + dif_part(j, y2);
          min_sl = min(min_sl, sl);
        }
      cout << min_sl << "\n";
    }
  }
  return 0;
}
