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 int INF = 2e9;
const double eps = 1e-8;
inline void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
inline void read(long long &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const int N = 100010;
int ele[N], sta[N];
int n, m, cs, ce, v;
inline int Up(int x, int y) { return (x + y - 1) / y; }
signed main() {
  read(n);
  read(m);
  read(cs);
  read(ce);
  read(v);
  for (int i = 1; i <= cs; i++) read(sta[i]);
  for (int i = 1; i <= ce; i++) read(ele[i]);
  int q;
  read(q);
  for (int cas = 1; cas <= q; cas++) {
    int x1, y1, x2, y2;
    read(x1);
    read(y1);
    read(x2);
    read(y2);
    if (x1 == x2) {
      printf("%d\n", abs(y1 - y2));
      continue;
    }
    int id;
    int ans = INF;
    id = lower_bound(ele + 1, ele + ce + 1, y1) - ele - 1;
    if (id) {
      int dis = abs(ele[id] - y1) + Up(abs(x2 - x1), v) + abs(ele[id] - y2);
      ans = min(ans, dis);
    }
    id = lower_bound(ele + 1, ele + ce + 1, y1) - ele;
    if (id <= ce) {
      int dis = abs(ele[id] - y1) + Up(abs(x2 - x1), v) + abs(ele[id] - y2);
      ans = min(ans, dis);
    }
    id = lower_bound(sta + 1, sta + cs + 1, y1) - sta - 1;
    if (id) {
      int dis = abs(sta[id] - y1) + abs(x2 - x1) + abs(sta[id] - y2);
      ans = min(ans, dis);
    }
    id = lower_bound(sta + 1, sta + cs + 1, y1) - sta;
    if (id <= cs) {
      int dis = abs(sta[id] - y1) + abs(x2 - x1) + abs(sta[id] - y2);
      ans = min(ans, dis);
    }
    printf("%d\n", ans);
  }
  return 0;
}
