description: A rectangle with its opposite corners in (0, 0) and (w, h) and sides parallel to the axes is drawn on a plane.
  
  You are given a list of lattice points such that each point lies on a side of a rectangle but not in its corner. Also, there are at least two points on every side of a rectangle.
  
  Your task is to choose three points in such a way that: 
  
    * exactly two of them belong to the same side of a rectangle; 
    * the area of a triangle formed by them is maximum possible. 
  
  
  
  Print the doubled area of this triangle. It can be shown that the doubled area of any triangle formed by lattice points is always an integer.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of testcases.
  
  The first line of each testcase contains two integers w and h (3 ≤ w, h ≤ 10^6) — the coordinates of the corner of a rectangle.
  
  The next two lines contain the description of the points on two horizontal sides. First, an integer k (2 ≤ k ≤ 2 ⋅ 10^5) — the number of points. Then, k integers x_1 < x_2 < ... < x_k (0 < x_i < w) — the x coordinates of the points in the ascending order. The y coordinate for the first line is 0 and for the second line is h.
  
  The next two lines contain the description of the points on two vertical sides. First, an integer k (2 ≤ k ≤ 2 ⋅ 10^5) — the number of points. Then, k integers y_1 < y_2 < ... < y_k (0 < y_i < h) — the y coordinates of the points in the ascending order. The x coordinate for the first line is 0 and for the second line is w.
  
  The total number of points on all sides in all testcases doesn't exceed 2 ⋅ 10^5.
  
  Output
  
  For each testcase print a single integer — the doubled maximum area of a triangle formed by such three points that exactly two of them belong to the same side.
  
  Example
  
  Input
  
  
  3
  5 8
  2 1 2
  3 2 3 4
  3 1 4 6
  2 4 5
  10 7
  2 3 9
  2 1 7
  3 1 3 4
  3 4 5 6
  11 5
  3 1 6 8
  3 3 6 8
  3 1 3 4
  2 2 4
  
  
  Output
  
  
  25
  42
  35
  
  Note
  
  The points in the first testcase of the example: 
  
    * (1, 0), (2, 0); 
    * (2, 8), (3, 8), (4, 8); 
    * (0, 1), (0, 4), (0, 6); 
    * (5, 4), (5, 5). 
  
  
  
  The largest triangle is formed by points (0, 1), (0, 6) and (5, 4) — its area is 25/2. Thus, the doubled area is 25. Two points that are on the same side are: (0, 1) and (0, 6).
solution: import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.*;
  
  import static java.lang.Math.max;
  import static java.lang.System.*;
  import static java.util.Arrays.parallelSetAll;
  import static java.util.Arrays.sort;
  import static java.util.Collections.reverseOrder;
  
  public class B {
      public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
      // public static final boolean LOCAL = System.getProperty("LOCAL")!=null;
      public static final String ANSI_RED = "\u001B[31m";
      public static final String ANSI_RESET = "\u001B[0m";
      static final int M = (int) 1e9 + 7;
      static final long MM = (long) M * M;
      static final int MAX = Integer.MAX_VALUE;
      static final int MIN = Integer.MIN_VALUE;
      static final int SIZE = (int) 1e9 * 2;
      static ArrayList<Integer> primes = new ArrayList<>();
      //static Scanner sc = new Scanner(System.in);
      static FastReader sc = new FastReader();
      static long startTime;
      static long endTime;
      static boolean[] prime;
      static int[] visited;
      static ArrayList<ArrayList<Integer>> graph;
      static ArrayList<Integer> dfs;
      static boolean isCyclic = false;
  
      public static int swap(int... args) {
          return args[0];
      }
  
      public static void main(String[] args) throws IOException {
          do {
              startTime = currentTimeMillis();
              //setOut(new PrintStream("output"));
              //setIn(new FileInputStream("input"));
              int T = sc.nextInt();while (T-- != 0)
              {
                  solve();
              }
              out.close();
              endTime = currentTimeMillis();
              long duration = endTime - startTime;
              //out.println(duration);
          } while (LOCAL);
      }
      static PrintWriter out = new PrintWriter(System.out);
      public static void solve() {
  /////////////////////////////////////////////////////////////////////
          int w =sc.nextInt(),h=sc.nextInt();
          ArrayList<Integer> h0 = new ArrayList<>();
          ArrayList<Integer> hh = new ArrayList<>();
  
          ArrayList<Integer> w0 = new ArrayList<>();
          ArrayList<Integer> ww = new ArrayList<>();
          int k =sc.nextInt();
          for (int i = 0; i < k; i++) {
              h0.add(sc.nextInt());
          }
  
          k =sc.nextInt();
          for (int i = 0; i < k; i++) {
              hh.add(sc.nextInt());
          }
  
          k =sc.nextInt();
          for (int i = 0; i < k; i++) {
              w0.add(sc.nextInt());
          }
  
          k =sc.nextInt();
          for (int i = 0; i < k; i++) {
              ww.add(sc.nextInt());
          }
  
          Collections.sort(h0);
          Collections.sort(hh);
          Collections.sort(w0);
          Collections.sort(ww);
  
          long maxH = Integer.max(h0.get(h0.size()-1)-h0.get(0),hh.get(hh.size()-1)-hh.get(0));
          long maxW = Integer.max(w0.get(w0.size()-1)-w0.get(0),ww.get(ww.size()-1)-ww.get(0));
  
  //        System.out.println("max = " + max);
  //        System.out.println("w = " + w);
  //        System.out.println("h = " + h);
          System.out.println(max(maxH*h,maxW*w));
  ///////////////////////////////////////////////////////////////////////
  
      }
       static void dfs(int src) {
          visited[src] = 1;
          for (Integer integer : graph.get(src)) {
              if (visited[integer] != 1) {
                  dfs(integer);
              }
          }
          dfs.add(src);
  
      }
  
      static void detectCycle(int src) {
          visited[src] = 2;
          for (Integer integer : graph.get(src)) {
              if (visited[integer] == 0) {
                  detectCycle(integer);
              } else if (visited[integer] == 2) {
                  isCyclic = true;
                  return;
              }
  
          }
          visited[src] = 1;
      }
  
      static <Array, Target> int count(Array[] array, Target target) {
          int cn = 0;
          for (Array value : array) {
              if (value.equals(target)) cn++;
          }
          return cn;
      }
  
      static int count(String string, char target) {
          int cn = 0;
          for (int i = 0; i < string.length(); i++) {
              if (string.charAt(i) == target) cn++;
          }
          return cn;
      }
  
      static <Array> void revArray(Array[] arr) {
          int n = arr.length;
          for (int i = 0; i < n / 2; i++) {
              Array temp = arr[i];
              arr[i] = arr[n - i - 1];
              arr[n - i - 1] = temp;
          }
  
      }
  
      static <Array> void printArray(Array[] arr) {
          int n = arr.length;
          for (Array array : arr) out.print(array + " ");
          out.println();
      }
  
      static void yes() {
          out.println("YES");
      }
  
      static void no() {
          out.println("NO");
      }
  
      public static boolean isPal(String s) {
          StringBuilder stringBuilder = new StringBuilder(s);
          return s.equals(stringBuilder.reverse().toString());
      }
  
      public static int lowerBound(Integer[] array, int length, int value) {
          int low = -1;
          int hi = length;
          while (low + 1 < hi) {
              int mid = (low + hi) / 2;
              if (array[mid] <= value) {
                  low = mid;
              } else {
                  hi = mid;
              }
          }
          return low;
      }
  
      public static int upperBound(Integer[] array, int length, int value) {
          int low = -1;
          int hi = length;
          while (low + 1 < hi) {
              int mid = (low + hi) >> 1;
              if (array[mid] >= value) {
                  hi = mid;
              } else low = mid;
          }
          return hi;
      }
  
      public static int binarySearch(Integer[] arr, int length, int value) {
          int low = 0;
          int hi = length - 1;
          int ans = -1;
          while (low <= hi) {
              int mid = (low + hi) >> 1;
              if (arr[mid] > value) {
                  hi = mid - 1;
              } else if (arr[mid] < value) {
                  low = mid + 1;
              } else {
                  ans = mid;
                  break;
              }
          }
          return ans;
      }
  
      public static int gcd(int a, int b) {
          return b == 0 ? a : gcd(b, a % b);
      }
  
      public static int lcm(int a, int b) {
          return a / gcd(a, b) * b;
      }
  
      public static int countDivs(int n) {
          int cn = 0;
          int sqr = (int) Math.sqrt(n);
          for (int i = 1; i <= sqr; ++i) {
              if (n % i == 0) {
                  ++cn;
              }
          }
          cn *= 2;
          if (sqr * sqr == n) cn--;
          return cn;
      }
  
      static void prime(int x) {
          //sieve algorithm. nlog(log(n)).
          prime = new boolean[(x + 1)];
          Arrays.fill(prime, true);
          prime[0] = prime[1] = false;
          for (int i = 2; i * i <= x; i++)
              if (prime[i])
                  for (int j = i * i; j <= x; j += i)
                      prime[j] = false;
      }
  
      static boolean isEven(long x) {
          return x % 2 == 0;
      }
  
      static boolean isPrime(long x) {
          boolean flag = true;
          int sqr = (int) Math.sqrt(x);
          if (x < 2) return false;
          for (int i = 2; i <= sqr; i++) {
              if (x % i == 0) {
                  flag = false;
                  break;
              }
          }
          return flag;
      }
  
      static long factorial(long x) {
          long total = 1;
          for (int i = 2; i <= x; i++)
              total = (total * i) % M;
          return total;
      }
  
      static long power1(long x, long y, long p) {
          long res = 1; // Initialize result
  
          x = x % p; // Update x if it is more than or
          // equal to p
  
          if (x == 0)
              return 0; // In case x is divisible by p;
  
          while (y > 0) {
  
              // If y is odd, multiply x with result
              if ((y & 1) != 0)
                  res = (res * x) % p;
  
              // y must be even now
              y = y >> 1; // y = y/2
              x = (x * x) % p;
          }
          return res;
      }
  
      static long power(long x, long n) {
          if (n == 0) {
              return 1;
          }
          long pow = power(x, n / 2L);
          if ((n & 1) == 1) {
              return (x % MM * (pow % MM) * (pow % MM)) % MM;
          }
          return (pow % MM * pow % MM) % MM;
      }
  
      private static <T> String ts(T t) {
          if (t == null) {
              return "null";
          }
          try {
              return ts((Iterable) t);
          } catch (ClassCastException e) {
              if (t instanceof int[]) {
                  String s = Arrays.toString((int[]) t);
                  return "{" + s.substring(1, s.length() - 1) + "}";
              } else if (t instanceof long[]) {
                  String s = Arrays.toString((long[]) t);
                  return "{" + s.substring(1, s.length() - 1) + "}";
              } else if (t instanceof char[]) {
                  String s = Arrays.toString((char[]) t);
                  return "{" + s.substring(1, s.length() - 1) + "}";
              } else if (t instanceof double[]) {
                  String s = Arrays.toString((double[]) t);
                  return "{" + s.substring(1, s.length() - 1) + "}";
              } else if (t instanceof boolean[]) {
                  String s = Arrays.toString((boolean[]) t);
                  return "{" + s.substring(1, s.length() - 1) + "}";
              }
              try {
                  return ts((Object[]) t);
              } catch (ClassCastException e1) {
                  return t.toString();
              }
          }
      }
  
      private static <T> String ts(T[] arr) {
          StringBuilder ret = new StringBuilder();
          ret.append("{");
          boolean first = true;
          for (T t : arr) {
              if (!first) {
                  ret.append(", ");
              }
              first = false;
              ret.append(ts(t));
          }
          ret.append("}");
          return ret.toString();
      }
  
      private static <T> String ts(Iterable<T> iter) {
          StringBuilder ret = new StringBuilder();
          ret.append("{");
          boolean first = true;
          for (T t : iter) {
              if (!first) {
                  ret.append(", ");
              }
              first = false;
              ret.append(ts(t));
          }
          ret.append("}");
          return ret.toString();
      }
  
      public static void dbg(Object... o) {
          if (LOCAL) {
              System.err.print("Line #" + Thread.currentThread().getStackTrace()[2].getLineNumber() + ": [");
              for (int i = 0; i < o.length; i++) {
                  if (i != 0) {
                      System.err.print(", ");
                  }
                  System.err.print(ts(o[i]));
              }
              System.err.println("]");
          }
      }
  
      static class FastReader {
          BufferedReader br;
          StringTokenizer st;
  
          public FastReader() {
              br = new BufferedReader(new
                      InputStreamReader(System.in));
          }
  
          String next() {
              while (st == null || !st.hasMoreElements()) {
                  try {
                      st = new StringTokenizer(br.readLine());
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
      }
  
      static class Pair implements Comparable<Pair> {
          private int index;
          private int val;
          private int cor;
  
          public Pair(int index, int val, int cor) {
              this.index = index;
              this.val = val;
              this.cor = cor;
          }
  
          @Override
          public String toString() {
              return "Pair{" + "x=" + index + ", y=" + val + '}';
          }
  
          @Override
          public int compareTo(Pair o) {
              return 0;
          }
      }
  
  }
  