Grammy has a special two-dimensional coordinate system: the angle between the positive half-axis of the X-axis and the positive half-axis of the Y-axis is 60 degrees.
Consider the following graph. The vertices are all integer coordinates (x,y) such that at least one of x,y is odd and −2a+1≤x≤2a−1, −2b+1≤y≤2b−1, −2c+1≤x+y≤2c−1. The edges from (x,y) go to (x,y+1), (x,y−1), (x+1,y), (x−1,y), (x+1,y−1), and (x−1,y+1).
Find the size of the maximum independent set of vertices in this graph. Additionally, find the number of such sets modulo 998,244,353.
The first line contains an integer T (1≤T≤10), denoting the number of test cases.
Each of the following T lines contains three integers a, b, c (1≤a,b,c≤106).
Output T lines. Each line must contain two integers: the size of the maximum independent set and the number of such sets. Please note that the size should not be taken modulo 998,244,353.
The following picture shows the situation for the first and second test case of the sample.
Point J has coordinates (2,1), point F has coordinates (−1,0), and point H has coordinates (2,0). Among these three points, only H has even X-coordinate and even Y-coordinate. The neighbours of point A are BCDEFG.
In the first test case, the points that satisfy the conditions are NGBIJPFCKMLEDST.
The size of the maximum independent set is 7, and there are 4 ways: PNLBDJT, RMFBDJT, RMGECJT, RMGEISK.
In the second test case, the points that satisfy the conditions are GBIFCLED.
The size of the maximum independent set is 4, and there is one way: LGID.
