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;
const long long M = 2e5 + 6, MX = 1e9 + 6;
int i, j, cnt;
int st[M], el[M], s[M], arrS[M], diff[M];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  for (i = 1; i <= cl; i++) cin >> st[i];
  ;
  for (i = 1; i <= ce; i++) cin >> el[i];
  ;
  int q, stair, elev, stime, etime;
  cin >> q;
  while (q--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int lepos = upper_bound(el, el + ce + 1, y1) - el;
    lepos--;
    int repos = upper_bound(el, el + ce + 1, y1) - el;
    int lspos = upper_bound(st, st + cl + 1, y1) - st;
    lspos--;
    int rspos = upper_bound(st, st + cl + 1, y1) - st;
    int ls = st[lspos], rs = st[rspos], le = el[lepos], re = el[repos];
    int lsd = y1 - ls + abs(y2 - ls), rsd = rs - y1 + abs(y2 - rs);
    if (!ls) lsd = INT_MAX;
    if (!rs) rsd = INT_MAX;
    stime = min(lsd, rsd) + x2 - x1;
    int led = y1 - le + abs(y2 - le), red = re - y1 + abs(y2 - re);
    if (!le) led = INT_MAX;
    if (!re) red = INT_MAX;
    etime = min(led, red) + ceil((double)(x2 - x1) / (double)v);
    cout << min(stime, etime) << endl;
  }
}
