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>
#pragma warning(disable : 4996)
using namespace std;
const int maxn = 1e5 + 5;
const int inf = 0x3f3f3f3f;
int stair[maxn];
int ele[maxn];
int main() {
  int n, m, cl, ce, v;
  scanf("%d%d%d%d%d", &n, &m, &cl, &ce, &v);
  for (int i = 1; i <= cl; i++) {
    scanf("%d", &stair[i]);
  }
  stair[cl + 1] = inf;
  for (int i = 1; i <= ce; i++) {
    scanf("%d", &ele[i]);
  }
  ele[ce + 1] = inf;
  int q;
  scanf("%d", &q);
  while (q--) {
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &y1, &x1, &y2, &x2);
    int eletime;
    int statime;
    if (y1 < y2) {
      eletime = ceil((y2 - y1) * 1.0 / v);
      statime = y2 - y1;
    } else if (y2 < y1) {
      eletime = ceil((y1 - y2) * 1.0 / v);
      statime = y1 - y2;
    } else {
      if (x2 > x1)
        printf("%d\n", x2 - x1);
      else
        printf("%d\n", x1 - x2);
      continue;
    }
    int ans = inf;
    int left, right;
    right = lower_bound(ele, ele + ce + 2, x1) - ele;
    left = right - 1;
    if (x2 > x1) {
      if (right <= ce) {
        int index = ele[right];
        if (index < x2) {
          ans = min(ans, x2 - x1 + eletime);
        } else {
          ans = min(ans, index - x1 + index - x2 + eletime);
        }
      }
      if (left > 0) {
        int index = ele[left];
        ans = min(ans, x1 - index + x2 - index + eletime);
      }
    } else {
      if (left > 0) {
        int index = ele[left];
        if (index > x2) {
          ans = min(ans, x1 - x2 + eletime);
        } else {
          ans = min(ans, x1 - index + x2 - index + eletime);
        }
      }
      if (right <= ce) {
        int index = ele[right];
        ans = min(ans, index - x1 + index - x2 + eletime);
      }
    }
    right = lower_bound(stair, stair + cl + 2, x1) - stair;
    left = right - 1;
    if (x2 > x1) {
      if (right <= cl) {
        int index = stair[right];
        if (index < x2) {
          ans = min(ans, x2 - x1 + statime);
        } else {
          ans = min(ans, index - x1 + index - x2 + statime);
        }
      }
      if (left > 0) {
        int index = stair[left];
        ans = min(ans, x1 - index + x2 - index + statime);
      }
    } else {
      if (left > 0) {
        int index = stair[left];
        if (index > x2) {
          ans = min(ans, x1 - x2 + statime);
        } else {
          ans = min(ans, x1 - index + x2 - index + statime);
        }
      }
      if (right <= cl) {
        int index = stair[right];
        ans = min(ans, index - x1 + index - x2 + statime);
      }
    }
    printf("%d\n", ans);
  }
}
