#include <bits/stdc++.h>
using namespace std;
long long t, n, m, xa, xb, xc, xd, ya, yb, yc, yd;
int main(void) {
  scanf("%I64d", &t);
  while (t--) {
    scanf("%I64d%I64d", &n, &m);
    long long w, b;
    if (n % 2 == 0 || m % 2 == 0) {
      w = b = (n * m / 2);
    } else {
      w = (n * m / 2) + 1;
      b = (n * m / 2);
    }
    scanf("%I64d%I64d%I64d%I64d", &xa, &ya, &xb, &yb);
    scanf("%I64d%I64d%I64d%I64d", &xc, &yc, &xd, &yd);
    long long wab = abs(xb - xa) + 1;
    long long hab = abs(yb - ya) + 1;
    long long wcd = abs(xd - xc) + 1;
    long long hcd = abs(yd - yc) + 1;
    long long cnt = 0;
    if (wab % 2 == 0 || hab % 2 == 0) {
      cnt += (wab * hab / 2);
    } else {
      if ((xa + ya) % 2) {
        cnt += (((wab * hab) - 1) / 2 + 1);
      } else {
        cnt += (((wab * hab) - 1) / 2);
      }
    }
    if (wcd % 2 == 0 || hcd % 2 == 0) {
      cnt -= (wcd * hcd / 2);
    } else {
      if ((xc + yc) % 2) {
        cnt -= (((wcd * hcd) - 1) / 2);
      } else {
        cnt -= (((wcd * hcd) - 1) / 2 + 1);
      }
    }
    bool flag = true;
    if (max(xa, xb) < min(xc, xd) || max(ya, yb) < min(yc, yd) ||
        max(xc, xd) < min(xa, xb) || max(yc, yd) < min(ya, yb)) {
      flag = false;
    }
    if (flag) {
      long long xe = max(xa, xc);
      long long ye = max(ya, yc);
      long long xf = min(xb, xd);
      long long yf = min(yb, yd);
      long long wef = abs(xf - xe) + 1;
      long long hef = abs(yf - ye) + 1;
      if (wef % 2 == 0 || hef % 2 == 0) {
        cnt -= (wef * hef / 2);
      } else {
        if ((xe + ye) % 2) {
          cnt -= (((wef * hef) - 1) / 2 + 1);
        } else {
          cnt -= (((wef * hef) - 1) / 2);
        }
      }
    }
    printf("%I64d %I64d\n", w + cnt, b - cnt);
  }
  return 0;
}
