**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<map>
#include<set>
#include<math.h>

typedef long long ll;
using namespace std;

void solve() {
    int n, tmp, sum = 0, op = 0, type = 0; cin >> n;
    tmp = n;
    while (tmp) {
        sum += (tmp * 2 - 1) * tmp;
        op += tmp;
        tmp--;
    }
    cout << sum << ' ' << op << '\n';
    for (int i = 0; i < n; i++) {
        type += 1;
        for (int j = 1; j <= n - i; j++) {
            cout << type << ' ' << j << ' ';
            for (int k = 1; k <= n; k++) cout << k << ' ';
            cout << '\n';
        }
        type %= 2;
    }
}

int main()
{
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll t;
    cin >> t;
    while (t--) {
        solve();
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include<iostream>
    #include<vector>
    #include<string>
    #include<map>
    #include<unordered_map>
    #include<cmath>
    #include<algorithm>
    #include<set>
    #include<tuple>
    #include<cmath>
    #include<queue>
    using namespace std;
    void compete_solution();

    template <typename T>
    void print(const std::vector<T>& vec) {
    for (auto element : vec) {
        std::cout << element << " ";
    }
    std::cout << std::endl;
    }

    int gcd(int x, int y)
    {
    if (y == 0)
        return x;
    return gcd(y, x % y);
    }
    int main()
    {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ;
        int roundc;
        cin >> roundc;
        for (int ic = 0; ic < roundc; ++ic)
        {
            compete_solution();
        }
        return 0;
    }
    void compete_solution()
    {
        int n;
        cin>>n;
        long long sum=0;
        int left=n/2+1;
        int right=n;
        int line=(right-left+1)*(right+left)/2;
        sum+=line*n;
        //cout<<sum<<endl;
        int s=0;
        for(int i=1;i<=n;++i)
        s+=i;
        sum+=n/2*s;

        cout<<sum<<" "<<n+n/2<<endl;
        for(int i=1;i<=n;++i)
        {
            cout<<1<<" "<<i<<" ";
            for(int j=1;j<=n;++j)
            cout<<j<<" ";
            cout<<endl;
        }
        for(int i=1;i<=n/2;++i)
        {
            cout<<2<<" "<<i<<" ";
            for(int j=1;j<=n;++j)
            cout<<j<<" ";
            cout<<endl;
        }

    }

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, let's consider the following:

1. **Edge Case Analysis**:
   - **Small n**: The code might handle small values of `n` differently, so we should test with `n = 1` and `n = 2`.
   - **Odd n**: The code might handle odd and even `n` differently. We should test with an odd `n` like `n = 3`.
   - **Large n**: Although the test input should be small, we can test with a slightly larger `n` like `n = 10` to see if the code handles it correctly.

2. **Multiple Test Cases**:
   - We should include multiple test cases to ensure the code handles different scenarios. For example, we can include `n = 1`, `n = 2`, and `n = 3`.

3. **Output Verification**:
   - For each test case, we need to verify the output to ensure it matches the expected behavior. The expected output for each `n` is:
     - For `n = 1`: The maximum sum is `1` and it requires `1` operation.
     - For `n = 2`: The maximum sum is `7` and it requires `3` operations.
     - For `n = 3`: The maximum sum is `27` and it requires `4` operations.

Given these considerations, the following test input should be challenging for the buggy code:

```plaintext
3
1
2
3
```

This test input includes three test cases with `n = 1`, `n = 2`, and `n = 3`, which should help expose any bugs in the code, especially in handling different values of `n`.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
import java.io.*;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner scanner=new Scanner(System.in);
        int t=scanner.nextInt();
        for (int i = 0; i < t; i++) {
            int n=scanner.nextInt();
            int s=0;
            int m=2*n-1;
            for (int j = 1,k = 1; j <= n;k+=2, j++) {
                s+=j*k;
            }
            System.out.println(s+" "+m);
            System.out.print(1+" "+n+" ");
            for (int j = 1; j <= n; j++) {
                System.out.print(j+" ");
            }

            for (int j = 1; j < 2*(n-1); j++) {
                System.out.println();
                System.out.print(1+" "+(n-j)+" ");
                for (int k = 1; k <= n; k++) {
                    System.out.print(k+" ");
                }
                System.out.println();
                System.out.print(2+" "+(n-j)+" ");
                for (int k = 1; k <= n; k++) {
                    System.out.print(k+" ");
                }
            }
            System.out.println();

        }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
import java.util.*;
import java.io.*;

public class Main {
    static Reader io = new Reader();

    public static void main(String[] args) {
        int t=io.nextInt();
        while (t-->0){
            int n=io.nextInt();
            StringBuilder sb=new StringBuilder(2*n);
            for (int i=1;i<=n;i++) sb.append(i).append(" ");
            String s=sb.toString();
            int sum=(int)((n-n/2)/2.0*(n/2+1+n)*n);
            int row=(int)(n/2.0*(1+n));
            sum+=n/2*row;
            io.print(sum+ " ");
            io.println(n+n/2);
            for (int i=1;i<=n;i++) {
                io.print(1+" "+i+" ");
                io.println(s);
            }
            for (int i=1;i<=n/2;i++) {
                io.print(2+" "+i+" ");
                io.println(s);
            }
        }
        io.flush();
    }
}

class Reader extends PrintWriter {
    BufferedReader br;
    StringTokenizer st;

    public Reader() {
        super(new BufferedOutputStream(System.out));
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = null;
        try {
            while (str == null) {
                if (st != null) {
                    if (st.hasMoreTokens()) {
                        str = "";
                        while (st.hasMoreTokens()) {
                            str += st.nextToken("\n");
                        }
                    } else {
                        str = br.readLine();
                    }
                } else {
                    str = br.readLine();
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

    int[] nextIntLine() {
        String[] temp = nextLine().split(" ");
        int[] a = new int[temp.length];
        for (int i = 0; i < temp.length; i++) {
            a[i] = Integer.parseInt(temp[i]);
        }
        return a;
    }

    long[] nextLongLine() {
        String[] temp = nextLine().split(" ");
        long[] a = new long[temp.length];
        for (int i = 0; i < temp.length; i++) {
            a[i] = Long.parseLong(temp[i]);
        }
        return a;
    }

    double[] nextDoubleLine() {
        String[] temp = nextLine().split(" ");
        double[] a = new double[temp.length];
        for (int i = 0; i < temp.length; i++) {
            a[i] = Double.parseDouble(temp[i]);
        }
        return a;
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1
2
3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <climits>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int N=510;
int t,n;
int arr[N][N];
void print(int n,int type,int i)
{
	printf("%d %d ",type,i);
	for(int i=1;i<=n;i++)printf("%d ",i);
	printf("\n");
}
int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&n);
		int res=0;
		for(int i=1;i<=n;i++)
			res+=i*(i*i-(i-1)*(i-1));
		printf("%d %d\n",res,(1+n)*n/2);
		int x=n;
		while(x)
		{
			if(x%2==0)
				for(int i=1;i<=x;i++)print(n,1,i);
			else
				for(int i=1;i<=x;i++)print(n,2,i);
			x--;
		}
	}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cmath>
#include <set>

using namespace std;

void solve(){
    int n;
    cin >> n;
    long long sum = 0;
    sum += n * n;
    sum += ((n * (n + 1)) / 2) * (n - 1);
    if(n > 2)
        sum += ((n - 2) * (n - 1))/ 2;
    cout << sum << " " << 2 * n << endl;
    for(int i = 0; i < n; ++i){
        string s = "";
        for(int j = n; j > 0; --j) {
            s += to_string(j) + " ";
        }
        cout << 2 << " " << i + 1 << " " << s << endl;
    }
    for(int i = 1; i < n; ++i){
        string s = "";
        for(int j = n; j > 0; --j) {
            s += to_string(j) + " ";
        }
        cout << 1 << " " << i + 1 << " " << s << endl;
    }
    string s = "";
    for(int j = n; j > 0; --j) {
        s += to_string(j) + " ";
    }
    cout << 2 << " " << n << " " << s << endl;
}

int main(){
    int t = 1;
    cin >> t;
    while(t--)
        solve();
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the given buggy code, we need to consider edge cases and scenarios that can highlight the issues in the code. The main issues in the buggy code are:

1. The sum calculation is incorrect.
2. The operations performed are not optimal and may not always maximize the sum of the matrix.

Let's focus on a small-scale test input that can reveal these issues. We will use a matrix size of 3, which is small enough to be manageable but large enough to show the bugs.

### Test Input
```plaintext
1
3
```

### Explanation
- **Test Case Count**: 1
- **Matrix Size**: 3

### Expected Output
The correct output for a 3x3 matrix should be:
- **Maximum Sum**: 18 (since the maximum sum is achieved by filling the matrix with the maximum possible values, which is the sum of all numbers from 1 to 3 repeated 3 times in each row and column).
- **Number of Operations**: 6 (since the problem allows up to 2n operations, which is 6 for n=3).

A correct solution would output something like:
```plaintext
18 6
1 1 3 2 1
1 2 3 2 1
1 3 3 2 1
2 1 3 2 1
2 2 3 2 1
2 3 3 2 1
```

### Buggy Code Output
The buggy code will output:
```plaintext
21 6
2 1 3 2 1
2 2 3 2 1
2 3 3 2 1
1 2 3 2 1
1 3 3 2 1
2 3 3 2 1
```

### Issues Highlighted
1. **Sum Calculation**: The buggy code calculates the sum as 21, which is incorrect. The correct maximum sum for a 3x3 matrix is 18.
2. **Operations**: The operations performed by the buggy code are not optimal. The permutations used are not maximizing the sum of the matrix.

By using the test input `1\n3`, we can clearly see the issues in the sum calculation and the operations performed by the buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include<iostream>
using namespace std;
#define int long long
int matrix[500][500];
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int T;cin>>T;
    int n,s,m;
    bool flag;
    while(T--){
        cin>>n;
        s=0,m=0;
        flag=false;
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j) matrix[i][j]=0;
        }
        for(int k=n;k;k>>=1){
            m+=k;
            for(int t=0;t<k;++t){
                for(int i=0;i<n;++i){
                    if(flag){
                        s+=i+1-matrix[i][t];
                        matrix[i][t]=i+1;
                    }
                    else{
                        s+=i+1-matrix[t][i];
                        matrix[t][i]=i+1;
                    }
                }
            }
            flag=!flag;
        }
        cout<<s<<' '<<m<<'\n';
        flag=false;
        for(int k=n;k;k>>=1){
            for(int t=0;t<k;++t){
                cout<<(flag ? '2' : '1')<<' '<<(t+1);
                for(int i=1;i<=n;++i) cout<<' '<<i;
                cout<<'\n';
            }
            flag=!flag;
        }
    }

    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1
2
5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin >> t;

    while(t--){
        int n;
        cin >> n;

        int s = 0;
        for(int i = 1; i <= n; i++){
            s += ((2*i*i) - i);
        }

        int m = ((2*n) - 1);

        cout << s << " " << m << "\n";

        for(int i = 1; i <= m; i++){
            cout << (i + 1)/2 << " " << (n - (i % n)) << " ";
            for(int j = 1; j <= n; j++){
                cout << j << " ";
            }
            cout << "\n";
        }
    }
    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
2
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
//for double/floating number don't use cout, please use printf.
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define pii 3.141592653589793
#define pb push_back
const int N = 100002;
const int M=100000;
const ll mxn =1e18;
const long long mod = 998244353;
#define FAST  ios::sync_with_stdio(false);cin.tie(NULL);
#define FF fflush(stdout);
#define lcm(a,b) (a*b)/__gcd(a,b)
#define F first
#define S second
#define mp make_pair
#define nl '\n'
#define vi vector<int>
#define forr(i,n,a) for(int i=0;i<n;i+=a)
set<int>::iterator it,itt;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
//#define ordered_set tree<pair<ll,ll>, null_type,less<pair<ll,ll> >, rb_tree_tag,tree_order_statistics_node_update>
typedef tree<int, null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> ordered_setl;
typedef tree<int, null_type,greater<int >, rb_tree_tag,tree_order_statistics_node_update> ordered_set2;
#define infinity 1<<30  //2^30

void solve()
{
     ll n,i,c,m,k,s=0,j;
     cin>>n;
     m=n+n/2;
     k=(n*(n+1))/2;
     for(i=1;i<=n;i++)
     {
         if(i<=n/2)s+=k;
         else s+=i*n;
     }
     cout<<s<<' '<<m<<endl;
     for(i=1;i<=n;i++)
     {
         cout<<1<<' '<<i<<' ';
         for(j=1;j<=n;j++)cout<<j<<' ';
         cout<<endl;
     }
     for(i=1;i<=n/2;i++)
     {
          cout<<2<<' '<<i<<' ';
         for(j=1;j<=n;j++)cout<<j<<' ';
         cout<<endl;
     }
}
int main()
{
    FAST
    int tc=1;
    cin>>tc;
    while(tc--)
    {
        solve();
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
import math
from collections import Counter, deque, defaultdict
from operator import add, sub, mul, itemgetter
from itertools import accumulate
import heapq
from sys import stdin, stdout
from functools import lru_cache
from types import GeneratorType
from random import getrandbits

# Variables
MOD = 10**9 + 7
MAX = 10**9
letters = list("abcdefghijklmnopqrstuvwxyz")
RANDOM = getrandbits(20)

class Wrapper(int):
    def __init__(self, x):
        int.__init__(x)

    def __hash__(self):
        return super(Wrapper, self).__hash__() ^ RANDOM

class PriorityQueue(object):
    def __init__(self, initial=None, key=lambda x: x):
        self.key = key
        self.index = 0
        if initial:
            self._data = [(key(item), i, item) for i, item in enumerate(initial)]
            self.index = len(self._data)
            heapq.heapify(self._data)
        else:
            self._data = []

    def push(self, item):
        heapq.heappush(self._data, (self.key(item), self.index, item))
        self.index += 1

    def pop(self):
        return heapq.heappop(self._data)[2]

class Factorial:
    def __init__(self, MOD=10**9 + 7):
        self.MOD = MOD
        self.factorials = [1, 1]
        self.invModulos = [0, 1]
        self.invFactorial_ = [1, 1]

    def calc(self, n):
        if n <= -1:
            print("Invalid argument to calculate n!")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        if n < len(self.factorials):
            return self.factorials[n]
        nextArr = [0] * (n + 1 - len(self.factorials))
        initialI = len(self.factorials)
        prev = self.factorials[-1]
        m = self.MOD
        for i in range(initialI, n + 1):
            prev = nextArr[i - initialI] = prev * i % m
        self.factorials += nextArr
        return self.factorials[n]

    def inv(self, n):
        if n <= -1:
            print("Invalid argument to calculate n^(-1)")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        p = self.MOD
        pi = n % p
        if pi < len(self.invModulos):
            return self.invModulos[pi]
        nextArr = [0] * (n + 1 - len(self.invModulos))
        initialI = len(self.invModulos)
        for i in range(initialI, min(p, n + 1)):
            next = -self.invModulos[p % i] * (p // i) % p
            self.invModulos.append(next)
        return self.invModulos[pi]

    def invFactorial(self, n):
        if n <= -1:
            print("Invalid argument to calculate (n^(-1))!")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        if n < len(self.invFactorial_):
            return self.invFactorial_[n]
        self.inv(n)  # To make sure already calculated n^-1
        nextArr = [0] * (n + 1 - len(self.invFactorial_))
        initialI = len(self.invFactorial_)
        prev = self.invFactorial_[-1]
        p = self.MOD
        for i in range(initialI, n + 1):
            prev = nextArr[i - initialI] = (prev * self.invModulos[i % p]) % p
        self.invFactorial_ += nextArr
        return self.invFactorial_[n]

class Combination:
    def __init__(self, MOD=10**9 + 7):
        self.MOD = MOD
        self.factorial = Factorial(MOD)

    def ncr(self, n, k):
        if k < 0 or n < k:
            return 0
        k = min(k, n - k)
        f = self.factorial
        return (
            f.calc(n)
            * f.invFactorial(max(n - k, k))
            * f.invFactorial(min(k, n - k))
            % self.MOD
        )

class SparseTable1:
    """Element-based Sparse Table"""

    def __init__(self, lst, fun="max"):
        """static range queries can be performed as long as the range_merge_to_disjoint fun satisfies monotonicity"""
        self.fun = fun
        self.n = len(lst)
        self.lst = lst
        self.f = [[0] * (int(math.log2(self.n)) + 1) for _ in range(self.n + 1)]
        self.gen_sparse_table()

        return

    def gen_sparse_table(self):
        """the same as multiplication method for tree_lca"""
        for i in range(1, self.n + 1):
            self.f[i][0] = self.lst[i - 1]
        for j in range(1, int(math.log2(self.n)) + 1):
            for i in range(1, self.n - (1 << j) + 2):
                a = self.f[i][j - 1]
                b = self.f[i + (1 << (j - 1))][j - 1]
                if self.fun == "max":
                    self.f[i][j] = a if a > b else b
                elif self.fun == "min":
                    self.f[i][j] = a if a < b else b
                elif self.fun == "gcd":
                    self.f[i][j] = math.gcd(a, b)
                elif self.fun == "lcm":
                    self.f[i][j] = a * b // math.gcd(a, b)
                elif self.fun == "and":
                    self.f[i][j] = a & b
                elif self.fun == "or":
                    self.f[i][j] = a | b
        return

    def query(self, left, right):
        """index start from 1
        query(max,min,gcd,lcm,and,or)
        """
        assert 1 <= left <= right <= self.n
        k = int(math.log2(right - left + 1))
        a = self.f[left][k]
        b = self.f[right - (1 << k) + 1][k]
        if self.fun == "max":
            return a if a > b else b
        elif self.fun == "min":
            return a if a < b else b
        elif self.fun == "gcd":
            return math.gcd(a, b)
        elif self.fun == "lcm":
            return math.lcm(a, b)
        elif self.fun == "and":
            return a & b
        elif self.fun == "or":
            return a | b

class PrimeTable:
    def __init__(self):
        self.n = 0

    def primeFactor(self, n):
        i = 2
        ret = {}
        rhoFlg = 0
        while i * i <= n:
            k = 0
            while n % i == 0:
                n //= i
                k += 1
            if k:
                ret[i] = k
            i += 1 + i % 2
            if i == 101 and n >= 2**20:
                while n > 1:
                    if self.isPrimeMR(n):
                        ret[n], n = 1, 1
                    else:
                        rhoFlg = 1
                        j = self.findFactorRho(n)
                        k = 0
                        while n % j == 0:
                            n //= j
                            k += 1
                        ret[j] = k

        if n > 1:
            ret[n] = 1
        if rhoFlg:
            ret = {x: ret[x] for x in sorted(ret)}
        return ret

    def isPrimeMR(self, n):
        d = n - 1
        d = d // (d & -d)
        L = (
            [2, 7, 61]
            if n < 1 << 32
            else (
                [2, 3, 5, 7, 11, 13, 17]
                if n < 1 << 48
                else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
            )
        )
        # L = [2, 3, 5, 7, 11, 13, 17]
        if n in L:
            return 1
        for a in L:
            t = d
            y = pow(a, t, n)
            if y == 1:
                continue
            while y != n - 1:
                y = (y * y) % n
                if y == 1 or t == n - 1:
                    return 0
                t <<= 1
        return 1

    def findFactorRho(self, n):
        m = 1 << n.bit_length() // 8
        for c in range(1, 99):
            f = lambda x: (x * x + c) % n
            y, r, q, g = 2, 1, 1, 1
            while g == 1:
                x = y
                for i in range(r):
                    y = f(y)
                k = 0
                while k < r and g == 1:
                    ys = y
                    for i in range(min(m, r - k)):
                        y = f(y)
                        q = q * abs(x - y) % n
                    g = gcd(q, n)
                    k += m
                r <<= 1
            if g == n:
                g = 1
                while g == 1:
                    ys = f(ys)
                    g = gcd(abs(x - ys), n)
            if g < n:
                if self.isPrimeMR(g):
                    return g
                elif self.isPrimeMR(n // g):
                    return n // g
                return self.findFactorRho(g)

    def get_factors(self, x, sort=False):
        """Not in ascending order"""
        factors = [1]
        for p, b in self.primeFactor(x).items():
            n = len(factors)
            for j in range(1, b + 1):
                for d in factors[:n]:
                    factors.append(d * (p**j))
        if sort:
            return sorted(factors)
        return factors

    @lru_cache(maxsize=None)
    def chkprime(self, n):
        st = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}
        # assert 1 <= n and n <= 1<<64 # = 18446744073709551616
        if n == 1:
            return False
        if n == 2:
            return True
        if n & 1 == 0:
            return False
        if n in st:
            return True
        d = (n - 1) >> 1
        while d & 1 == 0:
            d >>= 1
        for a in st:
            t = d
            y = pow(a, t, n)
            while t != n - 1 and y != 1 and y != n - 1:
                y = (y * y) % n
                t <<= 1
                if y != n - 1 and t & 1 == 0:
                    return False
        return True

# -----------------------------------Sorted List------------------------------------------
class SortedList:
    def __init__(self, iterable=[], _load=200):
        """Initialize sorted list instance."""
        values = sorted(iterable)
        self._len = _len = len(values)
        self._load = _load
        self._lists = _lists = [values[i : i + _load] for i in range(0, _len, _load)]
        self._list_lens = [len(_list) for _list in _lists]
        self._mins = [_list[0] for _list in _lists]
        self._fen_tree = []
        self._rebuild = True

    def _fen_build(self):
        """Build a fenwick tree instance."""
        self._fen_tree[:] = self._list_lens
        _fen_tree = self._fen_tree
        for i in range(len(_fen_tree)):
            if i | i + 1 < len(_fen_tree):
                _fen_tree[i | i + 1] += _fen_tree[i]
        self._rebuild = False

    def _fen_update(self, index, value):
        """Update `fen_tree[index] += value`."""
        if not self._rebuild:
            _fen_tree = self._fen_tree
            while index < len(_fen_tree):
                _fen_tree[index] += value
                index |= index + 1

    def _fen_query(self, end):
        """Return `sum(_fen_tree[:end])`."""
        if self._rebuild:
            self._fen_build()

        _fen_tree = self._fen_tree
        x = 0
        while end:
            x += _fen_tree[end - 1]
            end &= end - 1
        return x

    def _fen_findkth(self, k):
        """Return a pair of (the largest `idx` such that `sum(_fen_tree[:idx]) <= k`, `k - sum(_fen_tree[:idx])`)."""
        _list_lens = self._list_lens
        if k < _list_lens[0]:
            return 0, k
        if k >= self._len - _list_lens[-1]:
            return len(_list_lens) - 1, k + _list_lens[-1] - self._len
        if self._rebuild:
            self._fen_build()

        _fen_tree = self._fen_tree
        idx = -1
        for d in reversed(range(len(_fen_tree).bit_length())):
            right_idx = idx + (1 << d)
            if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
                idx = right_idx
                k -= _fen_tree[idx]
        return idx + 1, k

    def _delete(self, pos, idx):
        """Delete value at the given `(pos, idx)`."""
        _lists = self._lists
        _mins = self._mins
        _list_lens = self._list_lens

        self._len -= 1
        self._fen_update(pos, -1)
        del _lists[pos][idx]
        _list_lens[pos] -= 1

        if _list_lens[pos]:
            _mins[pos] = _lists[pos][0]
        else:
            del _lists[pos]
            del _list_lens[pos]
            del _mins[pos]
            self._rebuild = True

    def _loc_left(self, value):
        """Return an index pair that corresponds to the first position of `value` in the sorted list."""
        if not self._len:
            return 0, 0

        _lists = self._lists
        _mins = self._mins

        lo, pos = -1, len(_lists) - 1
        while lo + 1 < pos:
            mi = (lo + pos) >> 1
            if value <= _mins[mi]:
                pos = mi
            else:
                lo = mi

        if pos and value <= _lists[pos - 1][-1]:
            pos -= 1

        _list = _lists[pos]
        lo, idx = -1, len(_list)
        while lo + 1 < idx:
            mi = (lo + idx) >> 1
            if value <= _list[mi]:
                idx = mi
            else:
                lo = mi

        return pos, idx

    def _loc_right(self, value):
        """Return an index pair that corresponds to the last position of `value` in the sorted list."""
        if not self._len:
            return 0, 0

        _lists = self._lists
        _mins = self._mins

        pos, hi = 0, len(_lists)
        while pos + 1 < hi:
            mi = (pos + hi) >> 1
            if value < _mins[mi]:
                hi = mi
            else:
                pos = mi

        _list = _lists[pos]
        lo, idx = -1, len(_list)
        while lo + 1 < idx:
            mi = (lo + idx) >> 1
            if value < _list[mi]:
                idx = mi
            else:
                lo = mi

        return pos, idx

    def add(self, value):
        """Add `value` to sorted list."""
        _load = self._load
        _lists = self._lists
        _mins = self._mins
        _list_lens = self._list_lens

        self._len += 1
        if _lists:
            pos, idx = self._loc_right(value)
            self._fen_update(pos, 1)
            _list = _lists[pos]
            _list.insert(idx, value)
            _list_lens[pos] += 1
            _mins[pos] = _list[0]
            if _load + _load < len(_list):
                _lists.insert(pos + 1, _list[_load:])
                _list_lens.insert(pos + 1, len(_list) - _load)
                _mins.insert(pos + 1, _list[_load])
                _list_lens[pos] = _load
                del _list[_load:]
                self._rebuild = True
        else:
            _lists.append([value])
            _mins.append(value)
            _list_lens.append(1)
            self._rebuild = True

    def discard(self, value):
        """Remove `value` from sorted list if it is a member."""
        _lists = self._lists
        if _lists:
            pos, idx = self._loc_right(value)
            if idx and _lists[pos][idx - 1] == value:
                self._delete(pos, idx - 1)

    def remove(self, value):
        """Remove `value` from sorted list; `value` must be a member."""
        _len = self._len
        self.discard(value)
        if _len == self._len:
            raise ValueError("{0!r} not in list".format(value))

    def pop(self, index=-1):
        """Remove and return value at `index` in sorted list."""
        pos, idx = self._fen_findkth(self._len + index if index < 0 else index)
        value = self._lists[pos][idx]
        self._delete(pos, idx)
        return value

    def bisect_left(self, value):
        """Return the first index to insert `value` in the sorted list."""
        pos, idx = self._loc_left(value)
        return self._fen_query(pos) + idx

    def bisect_right(self, value):
        """Return the last index to insert `value` in the sorted list."""
        pos, idx = self._loc_right(value)
        return self._fen_query(pos) + idx

    def count(self, value):
        """Return number of occurrences of `value` in the sorted list."""
        return self.bisect_right(value) - self.bisect_left(value)

    def __len__(self):
        """Return the size of the sorted list."""
        return self._len

    def __getitem__(self, index):
        """Lookup value at `index` in sorted list."""
        pos, idx = self._fen_findkth(self._len + index if index < 0 else index)
        return self._lists[pos][idx]

    def __delitem__(self, index):
        """Remove value at `index` from sorted list."""
        pos, idx = self._fen_findkth(self._len + index if index < 0 else index)
        self._delete(pos, idx)

    def __contains__(self, value):
        """Return true if `value` is an element of the sorted list."""
        _lists = self._lists
        if _lists:
            pos, idx = self._loc_left(value)
            return idx < len(_lists[pos]) and _lists[pos][idx] == value
        return False

    def __iter__(self):
        """Return an iterator over the sorted list."""
        return (value for _list in self._lists for value in _list)

    def __reversed__(self):
        """Return a reverse iterator over the sorted list."""
        return (value for _list in reversed(self._lists) for value in reversed(_list))

    def __repr__(self):
        """Return string representation of sorted list."""
        return "SortedList({0})".format(list(self))

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def lcm(a, b):
    return a * b // gcd(a, b)

def find_mex(arr):
    s = set(arr)
    i = 0
    while i in s:
        i += 1
    return i

# recursion limit fix decorator, change 'return' to 'yield' and add 'yield' before calling the function
def bootstrap(f):
    stack = []

    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to

    return wrappedfunc

def prefix(arr):
    return list(accumulate(arr, add))

def suffix(arr):
    return (prefix(reversed(arr)))[::-1]

def Sieve(n=100000):
    prime = [True for i in range(n + 1)]
    prime[0] = prime[1] = False
    primes_lst = []
    p = 2
    c = 0
    while p <= n:

        if prime[p] == True:
            c += 1
            primes_lst.append(p)
            for i in range(p * p, n + 1, p):
                prime[i] = False
        p += 1
    return primes_lst

def find_longest_match(a, b, alo=0, ahi=None, blo=0, bhi=None):
    b2j = {}
    for i, elt in enumerate(b):
        indices = b2j.setdefault(elt, [])
        indices.append(i)
    if ahi is None:
        ahi = len(a)
    if bhi is None:
        bhi = len(b)
    besti, bestj, bestsize = alo, blo, 0
    j2len = {}
    nothing = []
    for i in range(alo, ahi):
        j2lenget = j2len.get
        newj2len = {}
        for j in b2j.get(a[i], nothing):
            if j < blo:
                continue
            if j >= bhi:
                break
            k = newj2len[j] = j2lenget(j - 1, 0) + 1
            if k > bestsize:
                besti, bestj, bestsize = i - k + 1, j - k + 1, k
        j2len = newj2len
    while besti > alo and bestj > blo and a[besti - 1] == b[bestj - 1]:
        besti, bestj, bestsize = besti - 1, bestj - 1, bestsize + 1
    while (
        besti + bestsize < ahi
        and bestj + bestsize < bhi
        and a[besti + bestsize] == b[bestj + bestsize]
    ):
        bestsize += 1

    return {"a": besti, "b": bestj, "size": bestsize}

class mydict:
    def __init__(self, func=lambda: 0):
        self.random = RANDOM
        self.default = func
        self.dict = {}

    def __getitem__(self, key):
        mykey = self.random ^ key
        if mykey not in self.dict:
            self.dict[mykey] = self.default()
        return self.dict[mykey]

    def get(self, key, default):
        mykey = self.random ^ key
        if mykey not in self.dict:
            return default
        return self.dict[mykey]

    def __setitem__(self, key, item):
        mykey = self.random ^ key
        self.dict[mykey] = item

    def getkeys(self):
        return [self.random ^ i for i in self.dict]

    def __str__(self):
        return f"{[(self.random ^ i, self.dict[i]) for i in self.dict]}"

def take_input(choice=""):
    if choice == "i":
        return int(stdin.readline().rstrip())
    if choice == "ii":
        return map(int, stdin.readline().rstrip().split())
    if choice == "ai":
        return list(map(int, stdin.readline().rstrip().split()))
    if choice == "as":
        return stdin.readline().rstrip().split()
    return stdin.readline().rstrip()

def write_arr(arr):
    (stdout.write(f"{arr[i]} ") for i in range(len(arr) - 1))
    stdout.write(f"{arr[-1]}\n")

def write_i(n):
    stdout.write(f"{n}\n")

def write(s):
    stdout.write(s)

# '-------------------------  MAIN  ---------------------------'

def solve():
    n=take_input('i')
    ans=[[2, i+1, [j for j in range(1,n+1)]] for i in range(n)]
    s = n*(n+1)//2
    k = s
    s *= n
    i=0
    r=0
    while k>n*(i+1):
        ans.append([1, i+1, [j for j in range(1,n+1)]])
        s += (k - n*(i+1))
        i+=1
        r+=1

    # if True:
    ans.append([2, 1, [j for j in range(1,n+1)]])
    r+=1
    s -= i
    s += i*(i+1)//2
    print(s,n+r)
    for i in ans:
        print(i[0],i[1],*i[2])

t = 1
t = take_input("i")
for _ in range(t):
    solve()

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
2
```

### Explanation:
1. **Test Case 1:**
   - **Matrix Size:** 1
   - **Expected Output:**
     - Maximum Sum: 1
     - Number of Operations: 1
     - Operations:
       - Type 1, Row 1, Permutation [1]

2. **Test Case 2:**
   - **Matrix Size:** 2
   - **Expected Output:**
     - Maximum Sum: 7
     - Number of Operations: 3
     - Operations:
       - Type 1, Row 1, Permutation [1, 2]
       - Type 1, Row 2, Permutation [1, 2]
       - Type 2, Column 1, Permutation [1, 2]

### Why These Test Cases?
- **Test Case 1 (n=1):** This is the simplest possible case, which tests the basic functionality of the algorithm. It ensures that the algorithm can handle a single-element matrix correctly.
- **Test Case 2 (n=2):** This is a slightly more complex case that involves a 2x2 matrix. It tests the algorithm's ability to handle multiple operations and permutations. The expected maximum sum is 7, which can be achieved with 3 operations, ensuring that the algorithm can handle the required operations efficiently.

These test cases are designed to be small and manageable while still exposing potential bugs in the algorithm.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
import sys
from collections import defaultdict, deque, Counter
import math
import heapq
import bisect
import random
#from functools import lru_cache
#from sortedcontainers import SortedList

dfsss,hashingggg = 0,0
def cinput():
    return sys.stdin.readline().rstrip()
def cprint(output):
    sys.stdout.write(output + '\n')
    sys.stdout.flush()
def rint():
    return int(cinput())
def rlist():
    return list(map(int, cinput().split()))
def rstring():
    return cinput()
def ristring():
    return list(map(int,rstring()))
def rslist():
    return list(cinput().split())
def rints():
    return list(map(int, cinput().split()))
def plist(lst):
    cprint(" ".join(map(str, lst)))
def print_2d_list(matrix):
    for row in matrix:
        cprint(" ".join(map(str, row)))
if dfsss:
    from types import GeneratorType

    def bootstrap(f, stack=[]):
        def wrappedfunc(*args, **kwargs):
            if stack:
                return f(*args, **kwargs)
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to

        return wrappedfunc
if hashingggg:
    RANDOM = random.randrange(2**62)
    def w(x):
        return x ^ RANDOM
inf = 10**20
testcases = rint()
while testcases:
    testcases -= 1
    n = rint()
    res = [[0]*n for i in range(n)]
    ans = []
    t = 0
    for i in range(n):
        temp = [1,i+1]
        t += 1
        for j in range(1,n+1):
            temp.append(j)
        ans.append(temp)
    for i in range(n):
        for j in range(n):
            res[i][j] = j+1
    s = (n*(n+1))//2

    for j in range(n-1):
        if True:
            temp = [2,j+1]
            t += 1
            for i in range(1,n+1):
                temp.append(i)
            ans.append(temp)
            for i in range(n):
                res[i][j] = i+1
    for i in range(1):
        if True:
            temp = [1,i+1]
            t += 1
            for j in range(1,n+1):
                temp.append(j)
            ans.append(temp)
            for j in range(n):
                res[i][j] = j+1

    ss = 0
    for i in range(n):
        for j in range(n):
            ss += res[i][j]
    dd = [ss,len(ans)]
    plist(dd)

    print_2d_list(ans)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To expose the bug in the given code, we need to consider edge cases and scenarios that might cause the code to fail. The code provided has a specific logic for filling the matrix, and we need to identify where it might go wrong. Here are the steps to generate a challenging test input:

1. **Single Element Matrix (n=1):**
   - This is a simple case, and the code should handle it correctly. However, it's a good starting point to ensure the basic logic works.

2. **Small Matrix (n=2):**
   - This case is more complex and can help identify issues with the permutation logic and the number of operations.

3. **Matrix with a Larger Size (n=3):**
   - This case can help identify issues with the loop and the way the matrix is filled.

4. **Matrix with a Size that is a Power of 2 (n=4):**
   - This can help identify issues with the permutation and the number of operations, especially when the matrix size is a power of 2.

5. **Matrix with a Size that is a Prime Number (n=7):**
   - This can help identify issues with the permutation and the number of operations, especially when the matrix size is a prime number.

Given these considerations, let's create a test input that includes these scenarios:

```plaintext
5
1
2
3
4
7
```

This test input includes:
- A single element matrix (n=1)
- A small matrix (n=2)
- A slightly larger matrix (n=3)
- A matrix with a size that is a power of 2 (n=4)
- A matrix with a size that is a prime number (n=7)

These cases should help expose any bugs in the code by testing a variety of matrix sizes and structures.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
import java.util.*;

public class Solution {
    static Scanner scanner;
    public static void main(String[] args) {
        scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int t = 0; t < N; t++) {
            solve();
        }
        scanner.close();
    }

    private static void solve() {
        int n = scanner.nextInt();
        int[][] a = new int[n][n];
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i <= n; i++) sb.append(i).append(' ');
        int m = n;
        int k = 0;
        while (m > 0) {
            k += m;
            m /= 2;
        }
        m = n;
        int p = 0;
        StringBuilder sb2 = new StringBuilder();
        while (m > 0) {
            if (p % 2 == 0) {
                for (int i = 0; i < m; i++) {
                    sb2.append("1 " + (i+1) + " " + sb + '\n');
                    f(a, i);
                }
            } else {
                for (int i = 0; i < m; i++) {
                    sb2.append("2 " + (i+1) + " " + sb + '\n');
                    g(a, i);
                }
            }
            p++;
            m /= 2;
        }
        int sum = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                sum += a[i][j];
            }
        }
        System.out.println(sum + " " + k);
        System.out.print(sb2);
    }

    private static void f(int[][] a, int i) {
        int n = a.length;
        int k = 1;
        for (int j = 0; j < n; j++) {
            a[i][j] = k++;
        }
    }

    private static void g(int[][] a, int j) {
        int n = a.length;
        int k = 1;
        for (int i = 0; i < n; i++) {
            a[i][j] = k++;
        }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
1
3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
import java.util.Scanner;

public class cp47 {
    public static void main(String []args){

        solve();
    }

    static void solve(){

        Scanner scanner = new Scanner(System.in);

        int t = scanner.nextInt();
        while(t-- > 0){
            int n = scanner.nextInt();
            long sum = 0;
            long cnt = 0;
            int [][] a = new int[n][n];
            long temp = (long) n * (n+1)/2;
            for(int i=0 ; i<n ; i++){
                for(int j=1 ; j<=n ; j++) {
                    a[i][j-1] = j;
                    sum += j;
                }
                cnt++;
            }

            long cnt1 = 0;
            for(int i=1 ; i<=n ; i++){
                if ((long) n * i < temp) {
                    for (int j = 0; j < n; j++) {
                        sum -= a[j][i - 1];
                        a[j][i - 1] = j+1;
                        sum += a[j][i - 1];
                    }
                    cnt1 ++;
                }
            }

            long cnt2 = 0;
            for(int i=0 ; i<n ; i++){
                long tm = 0;
                for(int j=0 ; j<n ; j++){
                    tm += a[i][j];
                }
                if(tm < temp){
                    for(int j=1 ; j<=n ; j++){
                        sum -= a[i][j-1];
                        a[i][j-1] = j;
                        sum += a[i][j-1];
                    }
                    cnt2 ++;
                }

            }

            long total = cnt + cnt1 + cnt2;

            System.out.println(sum + " " + total);

            for(int i=1 ; i<=n ; i++){
                System.out.print(1 + " " + i + " ");
                for(int j=1 ; j<=n ; j++) {
                    System.out.print(j + " ");
                }
                System.out.println();
            }
//
            for(int i=1 ; i<=cnt1 ; i++){
                System.out.print(2 + " " + i + " ");
                for(int j=1 ; j<=n ; j++) {
                    System.out.print(j + " ");
                }
                System.out.println();
            }

            for(int i=1 ; i<=cnt2 ; i++){
                System.out.print(1 + " " + i + " ");
                for(int j=1 ; j<=n ; j++) {
                    System.out.print(j + " ");
                }
                System.out.println();
            }
        }
    }
}

//1 2 3 4
//2 2 3 4
//3 3 3 4
//4 4 3 4

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
2
1
5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Nene's Magical Matrix
time_limit_ms: 2000
memory_limit_mb: 256
Description: The magical girl Nene has an $$$n\times n$$$ matrix $$$a$$$ filled with zeroes. The $$$j$$$-th element of the $$$i$$$-th row of matrix $$$a$$$ is denoted as $$$a_{i, j}$$$.

She can perform operations of the following two types with this matrix:

- Type $$$1$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{i, j}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.
- Type $$$2$$$ operation: choose an integer $$$i$$$ between $$$1$$$ and $$$n$$$ and a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Assign $$$a_{j, i}:=p_j$$$ for all $$$1 \le j \le n$$$ simultaneously.

Nene wants to maximize the sum of all the numbers in the matrix $$$\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{i,j}$$$. She asks you to find the way to perform the operations so that this sum is maximized. As she doesn't want to make too many operations, you should provide a solution with no more than $$$2n$$$ operations.

A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array), and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is $$$4$$$ in the array).

Input: Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of test cases follows.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 500$$$) — the size of the matrix $$$a$$$.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$5 \cdot 10^5$$$.

Output: For each test case, in the first line output two integers $$$s$$$ and $$$m$$$ ($$$0\leq m\leq 2n$$$) — the maximum sum of the numbers in the matrix and the number of operations in your solution.

In the $$$k$$$-th of the next $$$m$$$ lines output the description of the $$$k$$$-th operation:

- an integer $$$c$$$ ($$$c \in \{1, 2\}$$$) — the type of the $$$k$$$-th operation;
- an integer $$$i$$$ ($$$1 \le i \le n$$$) — the row or the column the $$$k$$$-th operation is applied to;
- a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ — the permutation used in the $$$k$$$-th operation.

Note that you don't need to minimize the number of operations used, you only should use no more than $$$2n$$$ operations. It can be shown that the maximum possible sum can always be obtained in no more than $$$2n$$$ operations.

Examples:
input:
2
1
2
output:
1 1
1 1 1
7 3
1 1 1 2
1 2 1 2
2 1 1 2

Note: In the first test case, the maximum sum $$$s=1$$$ can be obtained in $$$1$$$ operation by setting $$$a_{1, 1}:=1$$$.

In the second test case, the maximum sum $$$s=7$$$ can be obtained in $$$3$$$ operations as follows:

It can be shown that it is impossible to make the sum of the numbers in the matrix larger than $$$7$$$.

Buggy Code:
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define ll long long
int gcd(int a, int b)
{
    return b == 0 ? a : gcd(b, a % b);
}

/*
1 5 7 2
1 4 3 0

1 3 0 0
4
3
0
*/
void solve(){
  int n;
  cin>>n;
  vector<vector<int>>mat(n,vector<int>(n,0));
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++)mat[i][j]=j+1;
  }
  for(int j=0;j<n/2;j++){
    for(int i=0;i<n;i++){
      mat[i][j]=i+1;
    }
  }
  ll sum=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++)sum+=mat[i][j];
  }
  cout<<sum<<" ";
  cout<<n+(n+1)/2<<"\n";
  for(int i=0;i<n;i++){
    cout<<"1 "<<i+1<<" ";
    for(int j=0;j<n;j++)cout<<j+1<<" ";
  }
  for(int i=0;i<(n+1)/2;i++){
    cout<<"2 "<<i+1<<" ";
    for(int j=0;j<n;j++)cout<<j+1<<" ";
    cout<<"\n";
  }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    cin>>t;
    while(t--){
        solve();
        cout<<"\n";
    }

    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the given code, we need to consider the following aspects:

1. **Matrix Size (n)**: The code seems to handle small and medium-sized matrices, but we should test edge cases, such as the smallest and largest possible values for \( n \).
2. **Operations**: The code should perform operations to maximize the sum of the matrix elements. We need to ensure that the operations are performed correctly and that the sum is indeed maximized.
3. **Edge Cases**: Test with \( n = 1 \) and \( n = 500 \) to see if the code handles these edge cases correctly.

Let's consider the following test input:

### Test Input
```plaintext
2
1
500
```

### Explanation
1. **Test Case 1 (n = 1)**:
   - The matrix is a \( 1 \times 1 \) matrix.
   - The maximum sum is 1, and it can be achieved with a single operation.
   - This tests the smallest possible matrix.

2. **Test Case 2 (n = 500)**:
   - The matrix is a \( 500 \times 500 \) matrix.
   - The maximum sum is \( 500 \times 500 \times 500 / 2 \) (since each row and column can be filled with a permutation of 1 to 500).
   - This tests the largest possible matrix and ensures the code handles a large number of operations efficiently.

### Expected Output
For \( n = 1 \):
```plaintext
1 1
1 1 1
```

For \( n = 500 \):
The output will be more complex, but it should include the maximum sum and the number of operations, followed by the detailed operations. The exact operations will depend on the implementation, but the sum and the number of operations should be correct.

### Why This Test Input?
- **Edge Cases**: Testing with \( n = 1 \) and \( n = 500 \) ensures that the code handles both the smallest and largest possible inputs.
- **Complexity**: The \( n = 500 \) case will push the code to its limits, ensuring it can handle a large matrix and perform the required operations efficiently.
- **Simplicity**: The \( n = 1 \) case is simple and straightforward, making it easy to verify the correctness of the output.

This test input should help expose any bugs in the given code, especially those related to handling edge cases and large inputs.