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: // HOPE
  
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///////                                                                                                       //////////
  ///////                                                                                                       //////////
  ///////            RRRRRRRRRRRRR     YY          YY         AA               NN          NN                   //////////
  ///////            RR         RR      YY        YY        AA  AA             NN NN       NN                   //////////
  ///////            RR        RR         YY     YY        AA    AA            NN  NN      NN                   //////////
  ///////            RRRRRRRRRR            YY   YY       AAAAAAAAAAAA          NN    NN    NN                   //////////
  ///////            RR RR                   YY         AAAAAAAAAAAAAA         NN      NN  NN                   //////////
  ///////            RR   RR                 YY        AA            AA        NN       NN NN                   //////////
  ///////            RR     RR               YY       AA              AA       NN          NN                   //////////
  ///////            RR       RR_____________________________________________________________________________   //////////
  ////////                                                                                                      //////////
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //----------------------------------------------------------------------------------------------------------------------
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.*;
  
  public class Codeforces2 {
      static PrintWriter out = new PrintWriter(System.out);
      static final int mod=1_000_000_007;
  
      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());
          }
  
          int[] readIntArray(int n){
              int[] a = new int[n];
              for(int i=0;i<n;i++)
                  a[i] = nextInt();
              return a;
          }
  
          long[] readLongArray(int n){
              long[] a = new long[n];
              for(int i=0;i<n;i++)
                  a[i] = nextLong();
              return a;
          }
  
          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;
          }
      }
  
      //Try seeing general case
      static int[] bottom, top, left, right;
      public static void main(String[] args)
      {
          FastReader s = new FastReader();
          int t = s.nextInt();
          while(t-->0)
          {
              int w = s.nextInt();
              int h = s.nextInt();
              int b1=0,b2=0,b3=0,t1=0,t2=0,t3=0,l1=0,l2=0,l3=0,r1=0,r2=0,r3=0;
              for(int i=0;i<4;i++)
              {
                  int k = s.nextInt();
                  if(i==0)
                  {
                      for(int j=0;j<k;j++)
                      {
                          if(j==0)
                              b1 = s.nextInt();
                          else if(j==k-1)
                              b2 = s.nextInt();
                          else
                              b3 = s.nextInt();
                      }
                  }
                  else if(i==1)
                  {
                      for(int j=0;j<k;j++)
                      {
                          if(j==0)
                              t1 = s.nextInt();
                          else if(j==k-1)
                              t2 = s.nextInt();
                          else
                              t3 = s.nextInt();
                      }
                  }
                  else if(i==2)
                  {
                      for(int j=0;j<k;j++)
                      {
                          if(j==0)
                              l1 = s.nextInt();
                          else if(j==k-1)
                              l2 = s.nextInt();
                          else
                              l3 = s.nextInt();
                      }
                  }
                  else
                  {
                      for(int j=0;j<k;j++)
                      {
                          if(j==0)
                              r1 = s.nextInt();
                          else if(j==k-1)
                              r2 = s.nextInt();
                          else
                              r3 = s.nextInt();
                      }
                  }
              }
              long ans1 = (long) (l2 - l1) *w;
              long ans2 = (long) (r2 - r1) *w;
              long ans3 = (long) (b2 - b1) *h;
              long ans4 = (long) (t2 - t1) *h;
              long ans5 = Math.max((t2-t1)*l1, ((t2-t1)*r1));
              long ans6 = Math.max((b2-b1)*l2, ((b2-b1)*r2));
              long ans7 = Math.max((l2-l1)*t2, ((l2-l1)*b2));
              long ans8 = Math.max((r2-r1)*t1, ((r2-r1)*b1));
              long res1 = Math.max(ans1, Math.max(ans2, Math.max(ans3, ans4)));
              long res2 = Math.max(ans5, Math.max(ans6, Math.max(ans7, ans8)));
              out.println(Math.max(res1, res2));
          }
  
  
          out.close();
      }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
      /////////////////////////////////////////////////THE END///////////////////////////////////////////////////////////
      //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
      public static int gcd(int x,int y)
      {
          return y==0?x:gcd(y,x%y);
      }
      public static long gcd(long x,long y)
      {
          return y==0L?x:gcd(y,x%y);
      }
  
      public static int lcm(int a, int b) {
          return (a * b) / gcd(a, b);
      }
      public static long lcm(long a, long b) {
          return (a * b) / gcd(a, b);
      }
  
      public static long pow(long a,long b)
      {
          if(b==0L)
              return 1L;
          long tmp=1;
          while(b>1L)
          {
              if((b&1L)==1)
                  tmp*=a;
              a*=a;
              b>>=1;
          }
          return (tmp*a);
      }
  
      public static long modPow(long a,long b,long mod)
      {
          if(b==0L)
              return 1L;
          long tmp=1;
          while(b>1L)
          {
              if((b&1L)==1L)
                  tmp*=a;
  
              a*=a;
              a%=mod;
              tmp%=mod;
              b>>=1;
          }
          return (tmp*a)%mod;
      }
  
      static long mul(long a, long b) {
          return a*b%mod;
      }
  
      static long fact(int n) {
          long ans=1;
          for (int i=2; i<=n; i++) ans=mul(ans, i);
          return ans;
      }
  
      static long fastPow(long base, long exp) {
          if (exp==0) return 1;
          long half=fastPow(base, exp/2);
          if (exp%2==0) return mul(half, half);
          return mul(half, mul(half, base));
      }
  
      static void debug(int ...a)
      {
          for(int x: a)
              out.print(x+" ");
          out.println();
      }
  
      static void debug(long ...a)
      {
          for(long x: a)
              out.print(x+" ");
          out.println();
      }
  
      static void debugMatrix(int[][] a)
      {
          for(int[] x:a)
              out.println(Arrays.toString(x));
      }
      static void debugMatrix(long[][] a)
      {
          for(long[] x:a)
              out.println(Arrays.toString(x));
      }
  
      static void reverseArray(int[] a) {
          int n = a.length;
          int[] arr = new int[n];
          for (int i = 0; i < n; i++)
              arr[i] = a[n - i - 1];
          for (int i = 0; i < n; i++)
              a[i] = arr[i];
      }
  
      static void reverseArray(long[] a) {
          int n = a.length;
          long[] arr = new long[n];
          for (int i = 0; i < n; i++)
              arr[i] = a[n - i - 1];
          for (int i = 0; i < n; i++)
              a[i] = arr[i];
      }
  
      static void sort(int[] a)
      {
          ArrayList<Integer> ls = new ArrayList<>();
          for(int x: a) ls.add(x);
          Collections.sort(ls);
          for(int i=0;i<a.length;i++)
              a[i] = ls.get(i);
      }
  
      static void sort(long[] a)
      {
          ArrayList<Long> ls = new ArrayList<>();
          for(long x: a) ls.add(x);
          Collections.sort(ls);
          for(int i=0;i<a.length;i++)
              a[i] = ls.get(i);
      }
  
      static class Pair{
          int x, y;
          Pair(int x, int y)
          {
              this.x = x;
              this.y = y;
          }
  
          @Override
          public String toString() {
              return "Pair{" +
                      "x=" + x +
                      ", y=" + y +
                      '}';
          }
      }
      static class MyCmp implements Comparator<Pair>
      {
          public int compare(Pair p1, Pair p2)
          {
              return p1.x-p2.x;
          }
      }
  
  
  }
  