Frodo's Gift Wrapping

No attempts yetTime limit1sMemory limit256 MB

Problem

Frodo bought three birthday presents for Neo. Each present sits in its own rectangular gift box. Frodo wants to put all three gift boxes into a single rectangular wrapping box. A bigger wrapping box costs more, so he wants the one with the smallest area.

The size of the wrapping box depends on how the gift boxes are placed. The placement rules are:

  • Every side of a gift box is parallel to a side of the wrapping box.
  • Each gift box lies entirely inside the wrapping box, and no two gift boxes overlap.
  • A gift box is allowed to touch the border of the wrapping box.
  • A gift box can be rotated by 90 degrees.

For example, take gift boxes whose width ×\times height is 3×43 \times 4, 5×65 \times 6, and 4×14 \times 1. Placed as in the picture below, they need a wrapping box of size 8×8=648 \times 8 = 64.

Placed as in the next picture, the same three boxes need only a wrapping box of size 5×10=505 \times 10 = 50.

Given the sizes of the three gift boxes, find the smallest area of a wrapping box that safely holds all three.

Input

The first line contains the number of test cases TT (1T100001 \le T \le 10000).

Each test case consists of three lines. Each line contains two integers AA and BB (1A,B501 \le A, B \le 50), the width and the height of one gift box, separated by a space.

Output

For each test case, print on its own line the smallest area of a wrapping box that holds all three gift boxes.