Squares

No attempts yetTime limit1sMemory limit128 MB

Problem

There are nn axis-parallel squares in the plane. Each square is given by the coordinates (x,y)(x, y) of its lower-left corner and the side length ww; every side is parallel to the xx-axis or the yy-axis. The squares may have different sizes, may overlap, and may share corners.

From each square you choose exactly one point (any point inside the square, boundary included). For the chosen set of points, the diameter is defined as the maximum Euclidean distance between any pair of them. You want to choose one point from every square so that the diameter of the chosen points is as large as possible.

Let DD be that maximum possible diameter. Output D2D^2, the square of DD, as an integer.

As in the figure above with six squares, the largest diameter is the distance between two corner points taken from two different squares. The value D2D^2 is always an integer.

Input

The first line contains the number of test cases TT. Each test case begins with a line containing the number of squares nn (2n100,0002 \le n \le 100{,}000). Each of the next nn lines contains three integers xx, yy, and ww, where (x,y)(x, y) is the lower-left corner of a square and ww is its side length (0x,y10,0000 \le x, y \le 10{,}000 and 1w10,0001 \le w \le 10{,}000).

Output

For each test case, print a single line containing D2D^2, the square of the largest diameter DD obtainable by choosing one point from each square.