1. Abridged Problem Statement
Given an N×N grid of cells numbered 1…N² in row-major order, you start with a pointer on cell 1. You must plan a sequence of turns. On turn i you choose a distinct Ki (N ≤ Ki < 300) and tell the audience to move the pointer Ki steps (each step to an adjacent cell). Then you remove at least one cell—none of which may be the current pointer cell. After e turns, exactly one cell must remain. Output each turn as:
Ki Xi,1 Xi,2 … Xi,mi

2. Detailed Editorial

Goal
We must guarantee that whenever we remove a set of cells after Ki moves, the audience's unknown position cannot lie in the removed set. We do this by exploiting two well-known facts about reachability on a grid:

1. From a starting cell, the cells reachable in exactly K steps are those whose Manhattan distance d from the start satisfies d ≤ K and (K−d) even.
2. Parity (even/odd) of distance matters: colour the board like a checkerboard; a single move always flips the colour of the finger's cell, so after a move the possible positions all share one colour.

Construction Overview
We remove cells in "layers" defined by anti-diagonals (cells with constant i+j). Index rows and columns 0…N−1, start at (0,0). Let sum = i+j.

A) First Turn (remove everything with sum > N):
- Choose K1 = N.
- Reachable cells in exactly N steps from (0,0) are those with sum ≤ N and sum≡N (mod 2).
- Any cell with sum > N is unreachable ⇒ safe to remove all of them (the upper-right triangle) in one shot.

B) Remaining Possible Positions S1
After removing sum>N, the pointer must lie in S1 = {cells with sum≤N and parity(sum)=parity(N)}.

C) Removing One Diagonal Per Turn
We will now remove all cells with sum=N, then sum=N−1, …, down to sum=1, one diagonal each turn. To eliminate the diagonal sum=d, we pick Ki that makes every cell on that diagonal unreachable from S1 in exactly Ki moves.

- All cells in S1 share one checkerboard colour.
- If we pick Ki to be an odd number (and larger than N), then after Ki moves the pointer must land on a cell of the opposite colour.
- The diagonal cells we target share the colour of the surviving region, so they become unreachable ⇒ safe to remove that entire diagonal.

D) Ki Selection and Turn Count
- K1 = N (removes sum>N).
- For the next N turns (to kill diagonals from sum=N down to sum=1), choose Ki = the smallest odd number ≥N+1, then increase by 2 each time to keep them distinct and within [N, 300).
- After these N+1 total turns, only the cell (0,0) with sum=0 remains.

Complexity
We loop over all N² cells once for the first removal, and then over N diagonals of total size N each. Overall O(N²), which is fine for N≤100.

3. C++ Solution

```cpp
#include <bits/stdc++.h>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

int n;

void read() { cin >> n; }

void solve() {
    // Colour the N x N board like a checkerboard. Every single move flips the
    // colour of the finger's cell, so after a move the possible positions all
    // share one colour and we can safely remove the other colour's cells.
    //
    // - First turn: K = n moves; remove the upper-right triangle (cells with
    //   i + j > n) to shrink the reachable set.
    //
    // - Then n more turns with odd move counts n+1, n+3, ...: on each turn
    //   remove one anti-diagonal of the surviving region. Using distinct odd
    //   step counts keeps every K_i different and within [n, 300), and after
    //   all turns a single picture remains.

    vector<vector<int>> ans;

    ans.push_back({n});
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            if(i + j > n) {
                ans.back().push_back(i * n + j + 1);
            }
        }
    }

    int q = n + 1;
    if(q % 2 == 0) {
        q++;
    }

    for(int steps = 0; steps < n; steps++) {
        ans.push_back({q});
        int diag_x = 0, diag_y = n - steps;
        if(steps == 0) {
            diag_x = 1;
            diag_y = n - 1;
        }

        while(diag_y >= 0 && diag_x < n) {
            ans.back().push_back(diag_x * n + diag_y + 1);
            diag_x++;
            diag_y--;
        }
        q += 2;
    }

    for(auto it: ans) {
        for(auto x: it) {
            cout << x << ' ';
        }
        cout << '\n';
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        // cout << "Case #" << test << ": ";
        solve();
    }

    return 0;
}
```

4. Python Solution with Detailed Comments

```python
def magic_trick(N):
    # We'll build a list of turns. Each turn is [K, x1, x2, ...].
    turns = []

    # --- Turn 1 ---
    # K1 = N; remove all cells with i+j > N.
    line1 = [N]
    for i in range(N):
        for j in range(N):
            if i + j > N:
                # Compute 1-based index
                cell_id = i * N + j + 1
                line1.append(cell_id)
    turns.append(line1)

    # --- Subsequent N turns: remove diagonals ---
    # Start with the smallest odd K >= N+1
    K = N + 1
    if K % 2 == 0:
        K += 1

    # For each diagonal sum = N, N-1, ..., 1
    for step in range(N):
        current = [K]
        diag_sum = N - step

        # We want all (i, j) with i+j = diag_sum
        # But skip the invalid cell (0, N) on the first pass.
        if step == 0:
            i, j = 1, N-1
        else:
            i, j = 0, diag_sum

        # Walk the diagonal
        while 0 <= j < N and 0 <= i < N:
            cell_id = i * N + j + 1
            current.append(cell_id)
            i += 1
            j -= 1

        turns.append(current)
        K += 2  # next odd

    return turns

def main():
    import sys
    data = sys.stdin.read().strip().split()
    N = int(data[0])
    for line in magic_trick(N):
        print(' '.join(map(str, line)))

if __name__ == "__main__":
    main()
```

Explanation of Key Steps
- First removal (K=N) clears all cells too far (i+j>N).
- Then each further turn clears exactly one anti-diagonal (sum constant) by choosing an odd K large enough so that those diagonal cells are unreachable (parity mismatch) from any of the remaining positions.
- After N+1 turns, only the (0,0) cell survives.

5. Compressed Editorial
1. Reachability in exactly K moves ⇒ Manh. dist ≤K with parity match.
2. Turn 1: K=N removes all cells with i+j>N (too far). Remaining positions all share one checkerboard colour.
3. Next N turns: pick odd K>N. Each odd K flips parity, so cells on any diagonal with the surviving colour become unreachable ⇒ safe to remove whole diagonal.
4. Remove diagonals sum=N…1 in order. Only sum=0 cell remains.
