1IXMMMlOP0wTWg#&:;.

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Statement

You are given a coordinate plane and three integers X X , Y Y , and K K . Find two line segments AB AB and CD CD such that

  1. the coordinates of points A A , B B , C C , and D D are integers;
  2. 0Ax,Bx,Cx,DxX 0 \le A_x, B_x, C_x, D_x \le X and 0Ay,By,Cy,DyY 0 \le A_y, B_y, C_y, D_y \le Y ;
  3. the length of segment AB AB is at least K K ;
  4. the length of segment CD CD is at least K K ;
  5. segments AB AB and CD CD are perpendicular: if you draw lines that contain AB AB and CD CD , they will cross at a right angle.

Note that it's not necessary for segments to intersect. Segments are perpendicular as long as the lines they induce are perpendicular.

Format

Input

The first line contains a single integer t t ( 1t5000 1 \le t \le 5000 ) — the number of test cases. Next, t t cases follow.

The first and only line of each test case contains three integers X X , Y Y , and K K ( 1X,Y1000 1 \le X, Y \le 1000 ; 1K1414 1 \le K \le 1414 ).

Additional constraint on the input: the values of X X , Y Y , and K K are chosen in such a way that the answer exists.

Output

For each test case, print two lines. The first line should contain 4 4 integers Ax A_x , Ay A_y , Bx B_x , and By B_y — the coordinates of the first segment.

The second line should also contain 4 4 integers Cx C_x , Cy C_y , Dx D_x , and Dy D_y — the coordinates of the second segment.

If there are multiple answers, print any of them.

Sample

4
1 1 1
3 4 1
4 3 3
3 4 4
0 0 1 0
0 0 0 1
2 4 2 2
0 1 1 1
0 0 1 3
1 2 4 1
0 1 3 4
0 3 3 0

ShanghaiTech ACM 炸鱼杯

未参加
状态
已结束
规则
OI
题目
46
开始于
2024-12-10 23:00
结束于
2024-12-15 13:00
持续时间
110 小时
主持人
参赛人数
112