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 = 0x3f3f3f3f;
const long long mod = 1000000007;
const double e = 2.718281828459;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long gcd1(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long pow_mod(long long a, long long b, long long c) {
  long long ans = 1;
  a = a % c;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % c;
    b = b / 2;
    a = (a * a) % c;
  }
  return ans;
}
int pow_int(int a, int b) {
  int ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ans * a;
    b = b / 2;
    a = a * a;
  }
  return ans;
}
long long pow_llong(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ans * a;
    b = b / 2;
    a = a * a;
  }
  return ans;
}
const int dx[9] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
const int dy[9] = {0, 1, 0, -1, -1, -1, 0, 1, 1};
int Scan() {
  int res = 0, flag = 0;
  char ch;
  if ((ch = getchar()) == '-') {
    flag = 1;
  } else if (ch >= '0' && ch <= '9') {
    res = ch - '0';
  }
  while ((ch = getchar()) >= '0' && ch <= '9') {
    res = res * 10 + (ch - '0');
  }
  return flag ? -res : res;
}
void Out(int a) {
  if (a < 0) {
    putchar('-');
    a = -a;
  }
  if (a >= 10) {
    Out(a / 10);
  }
  putchar(a % 10 + '0');
}
long long jc_mod(long long a, long long b, long long mod) {
  long long ans = 1;
  b = max(b, a - b);
  for (long long i = a; i > b; i--) {
    ans *= i;
    ans %= mod;
  }
  return ans;
}
double lg(double a) { return (log(a) / log(10.0)); }
int lowbit(int x) { return x & -x; }
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void lisan(int *x, int n) {
  int data[100010];
  for (int i = 1; i <= n; i++) data[i] = x[i];
  sort(data + 1, data + 1 + n);
  int o = unique(data + 1, data + 1 + n) - data - 1;
  for (int i = 1; i <= n; i++)
    x[i] = lower_bound(data + 1, data + 1 + o, x[i]) - data;
}
long long calc(int M) { return 1; }
int sanfen(int L, int R) {
  int M, RM;
  while (L + 1 < R) {
    M = (L + R) / 2;
    RM = (M + R) / 2;
    if (calc(M) < calc(RM))
      R = RM;
    else
      L = M;
  }
  return L;
}
int CaculateWeekDay(int y, int m, int d) {
  if (m == 1 || m == 2) {
    m += 12;
    y--;
  }
  int iWeek = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
  return iWeek;
}
long long F[100010], E[100010];
int n, m, cl, ce, v;
int main() {
  scanf("%d%d", &n, &m);
  scanf("%d%d%d", &cl, &ce, &v);
  for (int i = 1; i <= cl; i++) scanf("%d", &F[i]);
  for (int i = 1; i <= ce; i++) scanf("%d", &E[i]);
  int q;
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    int y1, x1, y2, x2;
    scanf("%d%d", &y1, &x1);
    scanf("%d%d", &y2, &x2);
    if (y1 == y2) {
      printf("%d\n", abs(x1 - x2));
      continue;
    }
    int xmi = min(x1, x2);
    int xmx = max(x1, x2);
    int ymi = min(y1, y2);
    int ymx = max(y1, y2);
    long long ans = LLONG_MAX;
    if (cl) {
      int l = 1, r = cl;
      while (r > l) {
        int mid = (l + r) >> 1;
        if (F[mid] >= x1)
          r = mid;
        else
          l = mid + 1;
      }
      long long s1 = F[l] - x1;
      long long s2 = F[l] - x2;
      if (s1 < 0) s1 = -s1;
      if (s2 < 0) s2 = -s2;
      long long t = s1 + s2;
      if (l > 1) {
        long long s3 = F[l - 1] - x1;
        long long s4 = F[l - 1] - x2;
        if (s3 < 0) s3 = -s3;
        if (s4 < 0) s4 = -s4;
        t = min(t, s4 + s3);
      }
      ans = min(ans, t + ymx - ymi);
    }
    if (ce) {
      int l = 1, r = ce;
      while (r > l) {
        int mid = (l + r) >> 1;
        if (E[mid] >= x1)
          r = mid;
        else
          l = mid + 1;
      }
      long long s1 = E[l] - x1;
      long long s2 = E[l] - x2;
      if (s1 < 0) s1 = -s1;
      if (s2 < 0) s2 = -s2;
      long long t = s1 + s2;
      if (l > 1) {
        long long s3 = E[l - 1] - x1;
        long long s4 = E[l - 1] - x2;
        if (s3 < 0) s3 = -s3;
        if (s4 < 0) s4 = -s4;
        t = min(t, s4 + s3);
      }
      long long ss = (ymx - ymi) / v;
      if ((ymx - ymi) % v) ss++;
      ans = min(ans, t + ss);
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
