#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long n, m, cl, ce, v;
  cin >> n >> m >> cl >> ce >> v;
  int l[100001];
  int e[100001];
  for (int i = 0; i < cl; ++i) {
    cin >> l[i];
  }
  for (int i = 0; i < ce; ++i) {
    cin >> e[i];
  }
  int q;
  cin >> q;
  long long x1, y1, x2, y2;
  for (int i = 0; i < q; ++i) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y1 - y2) << endl;
      continue;
    }
    if (y1 > y2) {
      int temp = x1;
      x1 = x2;
      x2 = temp;
      temp = y1;
      y1 = y2;
      y2 = temp;
    }
    int p;
    int min = 0x3f3f3f3f;
    int yl = -1, yr = 0x3f3f3f3f;
    if (cl > 0) {
      if (y1 <= l[0]) {
        p = l[0];
      } else {
        p = -1;
        int left = 0;
        int right = cl - 1;
        int flag;
        while (true) {
          if (left == right) {
            p = l[left];
            break;
          }
          flag = (left + right) / 2;
          if (l[flag] == y1) {
            p = y1;
            break;
          } else if (l[flag] < y1) {
            if (l[flag + 1] > y1) {
              yl = l[flag];
              yr = l[flag + 1];
              break;
            } else {
              left = flag + 1;
            }
          } else {
            if (l[flag - 1] < y1) {
              yl = l[flag - 1];
              yr = l[flag];
              break;
            } else {
              right = flag - 1;
            }
          }
        }
        if (p == -1) {
          if (yr <= y2) {
            p = yr;
          } else {
            if (yr - y2 > y1 - yl) {
              p = yl;
            } else {
              p = yr;
            }
          }
        }
      }
      min = abs(y1 - p) + abs(x1 - x2) + abs(y2 - p);
    }
    yl = -1, yr = 0x3f3f3f3f;
    if (ce > 0) {
      if (y1 <= e[0]) {
        p = e[0];
      } else {
        p = -1;
        int left = 0;
        int right = ce - 1;
        int flag;
        while (true) {
          if (left == right) {
            p = e[left];
            break;
          }
          flag = (left + right) / 2;
          if (e[flag] == y1) {
            p = y1;
            break;
          } else if (e[flag] < y1) {
            if (e[flag + 1] > y1) {
              yl = e[flag];
              yr = e[flag + 1];
              break;
            } else {
              left = flag + 1;
            }
          } else {
            if (e[flag - 1] < y1) {
              yl = e[flag - 1];
              yr = e[flag];
              break;
            } else {
              right = flag - 1;
            }
          }
        }
        if (p == -1) {
          if (yr <= y2) {
            p = yr;
          } else {
            if (yr - y2 > y1 - yl) {
              p = yl;
            } else {
              p = yr;
            }
          }
        }
      }
      int r = abs(y1 - p) + abs(x1 - x2) / v + abs(y2 - p);
      if (abs(x1 - x2) % v > 0) {
        r++;
      }
      if (r < min) {
        min = r;
      }
    }
    cout << min << endl;
  }
  return 0;
}
