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

/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class TaskC {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();
    String[] s = br.readLine().split(" ");
    int nRows = Integer.parseInt(s[0]);
    int mCols = Integer.parseInt(s[1]);
    int nStairs = Integer.parseInt(s[2]);
    int nElevs = Integer.parseInt(s[3]);
    long v = Long.parseLong(s[4]);
    s = br.readLine().split(" ");
    
    TreeSet<Long> stairPos = new TreeSet<>();
    TreeSet<Long> elevPos = new TreeSet<>();
    stairPos.add(98765432100L);
    stairPos.add(-98765432100L);
    elevPos.add(98765432100L);
    elevPos.add(-98765432100L);

    //int[] stairPos = new int[nStairs];
    for (int i=0; i<nStairs; i++) {
      //stairPos[i] = Integer.parseInt(s[i]);
      stairPos.add(Long.parseLong(s[i]));
    }
    s = br.readLine().split(" ");
    //int[] elevPos = new int[nElevs];
    for (int i=0; i<nElevs; i++) {
      elevPos.add(Long.parseLong(s[i]));
      //elevPos[i] = Integer.parseInt(s[i]);
    }
    int q = Integer.parseInt(br.readLine());
    for (int i=0; i<q; i++) {
      s = br.readLine().split(" ");
      long r1 = Integer.parseInt(s[0]);
      long c1 = Integer.parseInt(s[1]);
      long r2 = Integer.parseInt(s[2]);
      long c2 = Integer.parseInt(s[3]);
      
      long minC = c1;
      long maxC = c2;
      if (c2<c1) {
        minC = c2;
        maxC = c1;
      }
      long cDist = 98765432100L;
      if (nStairs>0) {
        Long p2 = stairPos.higher(minC);
        if (p2<maxC) {
          cDist = maxC-minC;
        } else {
          Long p1 = stairPos.lower(minC);
          long d1 = 2*(minC-p1) + maxC-minC;
          if (d1<cDist) {
            cDist = d1;
          }
          Long p3 = stairPos.higher(maxC);
          long d3 = 2*(p3-maxC) + maxC-minC;
          if (d3<cDist) {
            cDist = d3;
          }
        }
      }
      long elevDist = 98765432100L;
      if (nElevs>0) {
        Long p2 = elevPos.higher(minC);
        if (p2<maxC) {
          elevDist = maxC-minC;
        } else {
          Long p1 = elevPos.lower(minC);
          long d1 = 2*(minC-p1) + maxC-minC;
          if (d1<elevDist) {
            elevDist = d1;
          }
          Long p3 = elevPos.higher(maxC);
          long d3 = 2*(p3-maxC) + maxC-minC;
          if (d3<elevDist) {
            elevDist = d3;
          }
        }
      }
      long minR = r1;
      long maxR = r2;
      if (r2<r1) {
        minR = r2;
        maxR = r1;
      }
      long floorDist = (maxR-minR)/v;
      if (v*floorDist != (maxR-minR)) {
        floorDist++;
      }
      long elevTime = floorDist + elevDist;
      long stairTime = cDist + (maxR-minR);
      if (elevTime<stairTime) {
        sb.append(elevTime+"\n");
      } else {
        sb.append(stairTime+"\n");
      }
      //int stairTime = getStairTime(r1,c1,r2,c2, stairPos, nStairs);
      //int elevTime = getElevTime(r1,c1,r2,c2, elevPos, nElevs, v);
    }
    System.out.print(sb);
  }
  /*
  static int getStairTime(int r1, int c1, int r2, int c2, int[] stairPos, int nStairs) {
    if (nStairs==0)
      return 987654321;
    if (c2)
    int p = Arrays.binarySearch()
  }
  */
}
