**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
#include <bits/stdc++.h>

using namespace std;

const int N = 100;

int n, m;
string s, t;
vector<int> grid[N][N];
char g[N][N];
vector<pair<int, int>> pos;
pair<int, int> pos_b;

void solve() {
	cin >> n >> m;
	pos.resize(21, pair<int, int>(-100000, -100000));
	pos_b = {-200000, -200000};
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> s;
			if (s[0] == '.') {
				if (s[1] == 'B') {
					pos_b = {i, j};
				}
			}
			if (s[0] == 'R') {
				if (s[1] == 'G') g[i][j] = 'R';
				else pos[s[1] - '0'] = {i, j};
			}
			else if (s[0] == 'B'){
				if (s[1] == 'G') g[i][j] = 'B';
				else pos[s[1] - '0' + 10] = {i, j};
			}
		}
	}
	int T;
	cin >> T;
	char act;
	int sr = 0, sb = 0;
	for (int i = 0; i < T; i++) {
		cin >> s;
		if (s == ".B") {
			cin >> act;
			switch (act) {
				case 'U' : pos_b.first--; break;
				case 'D' : pos_b.first++; break;
				case 'L' : pos_b.second--; break;
				case 'R' : pos_b.second++; break;
			}
			for (int j = 0; j < 20; j++) {
				if (pos[j] == pos_b) {
					pos[j] = {-100000, -100000};
					t.resize(2);
					t[0] = j < 10 ? 'R' : 'B';
					t[1] = j % 10 + '0';
					cout << i << " " << t << " ELIMINATED" << endl;
				}
			}
			continue;
		}
		else {
			int idx = s[1] - '0';
			if (s[0] == 'B') idx += 10;
			cin >> act;
			switch (act) {
				case 'U' : pos[idx].first--; break;
				case 'D' : pos[idx].first++; break;
				case 'L' : pos[idx].second--; break;
				case 'R' : pos[idx].second++; break;
				case 'C' : cin >> t; break;
				case 'T' :
				if (g[pos[idx].first][pos[idx].second] == 'R') sb++, cout << i << " BLUE GOAL" << endl;
				else if (g[pos[idx].first][pos[idx].second] == 'B') sr++, cout << i << " RED GOAL" << endl;
				break;
			}
			if (pos[idx] == pos_b) {
				pos[idx] = {-100000, -100000};
				cout << i << " " << s << " ELIMINATED" << endl;
			}
		}
	}
	cout << "FINAL SCORE: " << sr << " " << sb << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int yt = 1;
//	cin >> yt;
	while (yt--) {
		solve();
	}

	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 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

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

struct pos{
    int x;
    int y;
};

void move(pos& ent,char d){
    if (d=='U'){
        ent.y--;
    }
    if (d=='D'){
        ent.y++;
    }
    if (d=='L'){
        ent.x--;
    }
    if (d=='R'){
        ent.x++;
    }

}

int main(){
    int n;
    int m;
    cin >> n >> m;
    pos q={-1,-1};
    pos b={-2,-2};
    pos s={-1,-1};
    vector<pos> rteam(10,{-1,-1});
    vector<pos> bteam(10,{-1,-1});
    vector<bool> bcarry(10,0);
    vector<bool> rcarry(10,0);
    vector<vector<bool>> rgoal={};
    vector<vector<bool>> bgoal={};

    for (int i=0;i<n;i++){
        rgoal.push_back({});
        bgoal.push_back({});

        for (int j=0;j<m;j++){
            char unos;
            char unos2;
            cin >> unos >> unos2;
            if (unos=='R'){
                if (unos2=='G'){
                    rgoal[i].push_back(1);
                }
                else {
                    rgoal[i].push_back(0);
                    rteam[unos2-'0']={j,i};
                }
            }
            else {
                rgoal[i].push_back(0);
            }
            if (unos=='B'){
                if (unos2=='G'){
                    bgoal[i].push_back(1);
                }
                else {
                    bgoal[i].push_back(0);
                    bteam[unos2-'0']={j,i};
                }
            }
            else {
                bgoal[i].push_back(0);
            }
            if (unos=='.'){
                if (unos2=='Q'){
                    q={j,i};
                }
                if (unos2=='B'){
                    b={j,i};
                }
                if (unos2=='S'){
                    s={j,i};
                }

            }

        }
    }
    int t;
    cin >> t;
    int bodr=0;
    int bodb=0;
    bool carry=0;
    for (int i=0;i<t;i++){
        char koji1;
        char koji2;
        char vrs;
        cin >> koji1 >> koji2 >> vrs;
        if (vrs=='C'){
            char koji3;
            char koji4;
            cin >> koji3 >> koji4;
            if (koji1=='R'){
                if (koji4=='Q'){
                    rcarry[koji2-'0']=1;
                    carry=1;
                }
                if (koji4=='S'){
                    cout << i << " RED CATCH GOLDEN SNITCH\n";
                    bodr+=10;
                    break;
                }

            }
            else{
                if (koji4=='Q'){
                    bcarry[koji2-'0']=1;
                    carry=1;
                }
                if (koji4=='S'){
                    cout << i << " BLUE CATCH GOLDEN SNITCH\n";
                    bodb+=10;
                    break;
                }

            }

        }
        else if (vrs=='T'){
            carry=0;
            for (int j=0;j<10;j++){
                rcarry[j]=0;
                bcarry[j]=0;

            }
        }
        else {
            if (koji1=='R'){
                move(rteam[koji2-'0'],vrs);
                if (rcarry[koji2-'0']){
                    move(q,vrs);
                }
            }
            else if (koji1=='B'){
                move(bteam[koji2-'0'],vrs);
                if (bcarry[koji2-'0']){
                    move(q,vrs);
                }
            }
            else {
                if (koji2=='Q'){
                    move(q,vrs);
                }
                if (koji2=='B'){
                    move(b,vrs);
                }
                if (koji2=='S'){
                    move(s,vrs);
                }

            }
        }
        for (int j=0;j<10;j++){
            if (rteam[j].x==b.x && rteam[j].y==b.y){
                cout << i << " R" << j << " ELIMINATED\n";
                if (rcarry[j]){
                    carry=0;
                    rcarry[j]=0;
                }
                rteam[j]={-1,-1};
            }
            if (bteam[j].x==b.x && bteam[j].y==b.y){
                cout << i << " B" << j << " ELIMINATED\n";
                if (bcarry[j]){
                    carry=0;
                    bcarry[j]=0;
                }
                bteam[j]={-1,-1};
            }

        }
        if (rgoal[q.y][q.x] && !carry){
            cout << i << " BLUE GOAL\n";
            bodb++;
            q.y=n/2;
            q.x=m/2;
        }
        if (bgoal[q.y][q.x] && !carry){
            cout << i << " RED GOAL\n";
            bodr++;
            q.y=n/2;
            q.x=m/2;
        }
    }
    cout << "FINAL SCORE: " << bodr << " " << bodb << "\n";

}

**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 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 D
B0 L
B0 L
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
#include <bits/stdc++.h>

#define EPS 1e-9
#define PI acos(-1.0)
#define ll long long

using namespace std;
const ll N = 105, M = 1e7 + 5, MOD = 1e9+7, oo = 1e18, Q = 31;
int dx[] = {-1, 1, 0, 0}, Dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[] = {0, 0, 1, -1}, Dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

int n,m,t;
pair<int,int>red[N],blue[N],q,b,s;
int dir[10000],x[26],y[26];
set<int>st[N][N];
bool ownred[N],ownblue[N];
int goal[N][N];
int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>m;
    dir['U'-'A']=dir['D'-'A']=dir['L'-'A']=dir['R'-'A']=1;
    x['U'-'A']=-1,x['D'-'A']=1;
    y['L'-'A']=-1,y['R'-'A']=1;

    int g1=0,g2=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            char c1,c2;
            cin>>c1>>c2;
            if(c1=='R') {
                if(c2=='G') goal[i][j]=1;
                else red[c2-'0']={i,j},st[i][j].insert(c2-'0'+10);
            }
            if(c1=='B') {
                if(c2=='G') goal[i][j]=2;
                else blue[c2-'0']={i,j},st[i][j].insert(c2-'0');
            }
            if(c2=='Q') q={i,j};
            if(c2=='S') s={i,j};
            if(c2=='B') b={i,j};
        }
    }
    cin>>t;
    for(int i=0;i<t;i++){
        char c1,c2,d;
        cin>>c1>>c2>>d;
        int player=c2-'0',idx=d-'A';
        if(c1=='R'){
            if(dir[idx]){
                st[red[player].first][red[player].second].erase(player-10);
                red[player].first+=x[idx];
                red[player].second+=y[idx];
                st[red[player].first][red[player].second].insert(player-10);
                if(ownred[player]){
                    q.first+=x[idx];
                    q.second+=y[idx];
                }
                 if(b.first==red[player].first && b.second==red[player].second){
                    cout<<i<<" R"<<player<<" ELIMINATED"<<endl;
                    st[b.first][b.second].erase(player+10);
                    red[player]={0,0};
                }
            }
            if(d=='T') {
                ownred[player]=0;
                if(goal[q.first][q.second]){
                    if(goal[q.first][q.second]==1) cout<<i<<" BLUE GOAL"<<endl,g2++;
                    else cout<<i<<" RED GOAL"<<endl,g1++;
                    q={n/2+1,m/2+1};
                }
            }
            if(d=='C'){
                char c,ball;
                cin>>c>>ball;
                if(ball=='Q') ownred[player]=1;
            }
        }
        else if(c1=='B'){
            if(dir[idx]){
                st[blue[player].first][blue[player].second].erase(player);
                blue[player].first+=x[idx];
                blue[player].second+=y[idx];
                st[blue[player].first][blue[player].second].insert(player);
                if(ownblue[player]){
                    q.first+=x[idx];
                    q.second+=y[idx];
                }
                if(b.first==blue[player].first && b.second==blue[player].second){
                    cout<<i<<" B"<<player<<" ELIMINATED"<<endl;
                    st[b.first][b.second].erase(player);
                    blue[player]={0,0};
                }
            }
            if(d=='T') {
                ownblue[player]=0;
                if(goal[q.first][q.second]){
                    if(goal[q.first][q.second]==1) cout<<i<<" BLUE GOAL"<<endl,g2++;
                    else cout<<i<<" RED GOAL"<<endl,g1++;
                    q={n/2+1,m/2+1};
                }
            }
            if(d=='C'){
                char c,ball;
                cin>>c>>ball;
                if(ball=='Q') ownblue[player]=1;
            }
        }
        else if(c2=='B'){
            b.first+=x[idx];
            b.second+=y[idx];
            for(auto x:st[b.first][b.second]){
                cout<<i<<" ";
                if(x<10) cout<<"B"<<x,blue[x]={0,0};
                else cout<<"R"<<x-10,red[x-10]={0,0};
                cout<<" ELIMINATED"<<endl;
            }
            st[b.first][b.second].clear();
        }
    }
    cout<<"FINAL SCORE: "<<g1<<" "<<g2;
    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 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <algorithm>
#include <assert.h>

#define int long long
#define all(x) x.begin(), x.end()
#define ff first
#define ss second

using namespace std;

signed main() {
    int n, m, i, j, k;
    cin >> n >> m;
    vector<vector<string>>a(n, vector<string>(m));
    for(i=0;i<n;i++) {
        for(j=0;j<m;j++) {
            cin >> a[i][j];
        }
    }
    map<string,pair<int,int>>mp;
    vector<pair<int,int>>bg;
    vector<pair<int,int>>rg;
    for(i=0;i<n;i++) {
        for(j=0;j<m;j++) {
            if(a[i][j] == "..")continue;
            if(a[i][j] == "RG") {
                rg.push_back({i+1,j+1});
                continue;
            }
            if(a[i][j] == "BG") {
                bg.push_back({i+1,j+1});
                continue;
            }
            mp[a[i][j]] = {i+1,j+1};
        }
    }
    int t;
    cin >> t;
    int ind = 0;
    map<string,string>ball;
    map<string,pair<int,int>>izm;
    izm["U"] = {-1,0};
    izm["D"] = {1,0};
    izm["L"] = {0,-1};
    izm["R"] = {0,1};
    int ansr=0,ansb=0;
    if(mp.find(".B") == mp.end())mp[".B"] = {-1000,1000};
    while(t--) {
        string s;

        cin >> s;
        string dvig;
        cin >> dvig;
        if(izm.find(dvig) != izm.end()) {
            auto [x,y]= mp[s];
            x += izm[dvig].ff;
            y += izm[dvig].ss;
            if(ball.find(s) != ball.end()) {
                mp[ball[s]] = {x,y};
            }
            mp[s] = {x,y};
            set<string>el;
            for(auto it:mp) {
                if(it.ff == ".B")continue;
                if(it.ss == mp[".B"]) {
                    el.insert(it.ff);
                }
            }
            if((int)el.size() > 0) {
                cout << ind << " ";
                for(auto it:el) {
                    mp[it] = {-1e8,-1e8};
                    cout << it << " ";
                }
                cout << "ELIMINATED" << "\n";
            }
        }
        else {
            if(dvig == "C") {
                string bl;
                ball.clear();
                cin >> bl;
                if(bl == ".Q") {
                    ball[s] = bl;
                }
                else {
                    if (s[0] == 'R') {
                        cout << ind << " RED CATCH GOLDEN SNITCH" << "\n"; ansr += 10;
                    }
                    else {
                        cout << ind << " BLUE CATCH GOLDEN SNITCH" << "\n"; ansb += 10;
                    }
                    break;
                }
            }
            else {
                for(auto it:rg) {
                    if(it == mp[s]) {
                        ansb += 1;
                        cout << ind << " BLUE GOAL" << "\n";
                        mp[".Q"] = {(n+1)/2,(m+1)/2};
                        break;
                    }
                }
                for (auto it : bg) {
                    if (it == mp[s]) {
                        ansr += 1;
                        cout << ind << " RED GOAL" << "\n";
                        mp[".Q"] = {(n+1)/2,(m+1)/2};
                        break;
                    }
                }
                ball[s].clear();
            }

        }
        ind++;
    }
    cout << "FINAL SCORE: " << ansr << " " << ansb << "\n";
}

**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 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
6
R0 D
R0 C .Q
R0 T
B0 R
B0 T
R0 D
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
// LUOGU_RID: 164187212
#include<bits/stdc++.h>
using namespace std;
#define int long long
string s[105][105],ss[105][105],sss[105][105];
struct nn{
	int x,y;
};
map<string,nn> mp;
int n,m,ans1,ans2;
bool vis1[105][105];
bool vis2[105][105];
signed main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>s[i][j];
			ss[i][j]=sss[i][j]=s[i][j];
			mp[s[i][j]]={i,j};
		}
	}
	int T;
	cin>>T;
	for(int i=0;i<T;i++){
		string id;
		char ID;
		cin>>id>>ID;
		if(id==".B"){
			sss[mp[id].x][mp[id].y]="..";
			if(ID=='U')mp[id].x--;
			if(ID=='D')mp[id].x++;
			if(ID=='L')mp[id].y--;
			if(ID=='R')mp[id].y++;
			sss[mp[id].x][mp[id].y]=".B";
			if(s[mp[id].x][mp[id].y]!=".B"&&s[mp[id].x][mp[id].y]!=".."){
				cout<<i<<" "<<s[mp[id].x][mp[id].y]<<" ELIMINATED\n";
				mp[id]={0,0};
				s[mp[id].x][mp[id].y]="..";
			}
			continue;
		}
		if(ID=='U'){
			if(mp[".Q"].x==mp[id].x&&mp[".Q"].y==mp[id].y){
				mp[".Q"].x--;
			}
			mp[id].x--;
			s[mp[id].x][mp[id].y]=s[mp[id].x+1][mp[id].y];
			s[mp[id].x+1][mp[id].y]="..";
		}
		if(ID=='D'){
			if(mp[".Q"].x==mp[id].x&&mp[".Q"].y==mp[id].y){
				mp[".Q"].x++;
			}
			mp[id].x++;
			s[mp[id].x][mp[id].y]=s[mp[id].x-1][mp[id].y];
			s[mp[id].x-1][mp[id].y]="..";
		}
		if(ID=='L'){
			if(mp[".Q"].x==mp[id].x&&mp[".Q"].y==mp[id].y){
				mp[".Q"].y--;
			}
			mp[id].y--;
			s[mp[id].x][mp[id].y]=s[mp[id].x][mp[id].y+1];
			s[mp[id].x][mp[id].y+1]="..";
		}
		if(ID=='R'){
			if(mp[".Q"].x==mp[id].x&&mp[".Q"].y==mp[id].y){
				mp[".Q"].y++;
			}
			mp[id].y++;
			s[mp[id].x][mp[id].y]=s[mp[id].x][mp[id].y-1];
			s[mp[id].x][mp[id].y-1]="..";
		}
		if(ID=='C'){
			string ss;
			cin>>ss;
		}
		if(ID=='T'){
			if(ss[mp[".Q"].x][mp[".Q"].y]=="BG"){
				cout<<i<<" RED GOAL\n";
				ans1++;
			}
			if(ss[mp[".Q"].x][mp[".Q"].y]=="RG"){
				cout<<i<<" BLUE GOAL\n";
				ans2++;
			}
			mp[".Q"]={(n+1)/2,(m+1)/2};
		}
//		cout<<mp[id].x<<" "<<mp[id].y<<" "<<sss[3][2]<<"\n";
		if(sss[mp[id].x][mp[id].y]==".B"){
			cout<<i<<" "<<s[mp[id].x][mp[id].y]<<" ELIMINATED\n";
			mp[id]={0,0};
			s[mp[id].x][mp[id].y]="..";
		}
	}
	cout<<"FINAL SCORE: "<<ans1<<" "<<ans2;
     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 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 R
R0 T
R0 D
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

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

#ifdef DEBUG
#include "/home/mohammad/code/debug.h"
#else
#define dbg(...)
#define dbgarr(...)
#endif

void solve() {
    int n, m;
    cin >> n >> m;

    vector goal(n, vector<int>(m)); // 1-R, 2-B
    vector<array<int, 2>> player_r(11, {-1, -1}), player_b(11, {-1, -1});
    array<int, 2> Q, B;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            string s;
            cin >> s;
            if (s == "RG") {
                goal[i][j] = 1;
            }
            else if (s == "BG") {
                goal[i][j] = 2;
            }
            else if (s[0] == 'R') {
                player_r[s[1] - '0'] = {i, j};
            }
            else if (s[0] == 'B') {
                player_b[s[1] - '0'] = {i, j};
            }
            else if (s == ".Q") {
                Q = {i, j};
            }
            else if (s == ".B") {
                B = {i, j};
            }
        }
    }

    int t;
    cin >> t;
    int score_r = 0, score_b = 0;
    for (int i = 0; i < t; i++) {
        string who;
        cin >> who;

        if (who[0] == 'R') {
            string move;
            cin >> move;
            if (move == "U") {
                player_r[who[1] - '0'][0]--;
            }
            else if (move == "D") {
                player_r[who[1] - '0'][0]++;
            }
            else if (move == "L") {
                player_r[who[1] - '0'][1]--;
            }
            else if (move == "R") {
                player_r[who[1] - '0'][1]++;
            }
            else if (move == "C") {
                string ball;
                cin >> ball;
            }
            else if (move == "T") {
                auto [x, y] = player_r[who[1] - '0'];
                if (goal[x][y] == 2) {
                    score_r++;
                    cout << i << " RED GOAL\n";
                }
                else if (goal[x][y] == 1) {
                    score_b++;
                    cout << i << " BLUE GOAL\n";
                }
            }
            if (player_r[who[1] - '0'] == B) {
                cout << i << " R" << who[1] - '0' << " ELIMINATED\n";
            }
        }
        else if (who[0] == 'B') {
            string move;
            cin >> move;
            if (move == "U") {
                player_b[who[1] - '0'][0]--;
            }
            else if (move == "D") {
                player_b[who[1] - '0'][0]++;
            }
            else if (move == "L") {
                player_b[who[1] - '0'][1]--;
            }
            else if (move == "R") {
                player_b[who[1] - '0'][1]++;
            }
            else if (move == "C") {
                string ball;
                cin >> ball;
            }
            else if (move == "T") {
                auto [x, y] = player_b[who[1] - '0'];
                if (goal[x][y] == 2) {
                    score_r++;
                    cout << i << " RED GOAL\n";
                }
                else if (goal[x][y] == 1) {
                    score_b++;
                    cout << i << " BLUE GOAL\n";
                }
            }
            if (player_b[who[1] - '0'] == B) {
                cout << i << " B" << who[1] - '0' << " ELIMINATED\n";
            }
        }
        else if (who == ".B") {
            string move;
            cin >> move;
            if (move == "U") {
                B[0]--;
            }
            else if (move == "D") {
                B[0]++;
            }
            else if (move == "L") {
                B[1]--;
            }
            else if (move == "R") {
                B[1]++;
            }
            vector<int> e_r, e_b;
            for (int i = 0; i < 10; i++) {
                if (player_b[i] == B) {
                    e_b.push_back(i);
                }
                if (player_r[i] == B) {
                    e_r.push_back(i);
                }
            }
            if (e_b.size() || e_r.size()) {
                cout << i;
                for (auto p : e_b) {
                    cout << " B" << p;
                }
                for (auto p : e_r) {
                    cout << " R" << p;
                }
                cout << " ELIMINATED\n";
            }
        }
    }
    cout << "FINAL SCORE: " << score_r << ' ' << score_b << '\n';
}

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

    int t = 1;
    //cin >> t;

    while (t--) {
        solve();
    }

    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 expose the bug in the given buggy code, let's consider the following scenarios:

1. **Player Elimination by Bludger**: Ensure that players can be eliminated by the Bludger, and the elimination is correctly reported.
2. **Scoring in the Wrong Goal**: Ensure that if a player scores in the wrong goal, the correct team gets the point.
3. **Quaffle Movement and Catching**: Ensure that the Quaffle can be correctly caught and thrown, and the Quaffle's movement is tracked correctly.

Given these scenarios, let's create a small-scale test input that covers these cases:

### Test Input
```plaintext
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
B0 L
```

### Explanation
1. **Initial Field Setup**:
   - The field is a 5x5 grid.
   - Red goal (RG) and Blue goal (BG) are placed at (2, 0) and (2, 4) respectively.
   - Red player 0 (R0) and Blue player 0 (B0) are initially placed at (2, 2).
   - The Quaffle (.Q) is initially placed at (2, 2).
   - The Bludger (.B) is initially placed at (4, 2).

2. **Actions**:
   - **Step 0**: R0 moves down (D) to (3, 2).
   - **Step 1**: R0 catches the Quaffle (C .Q).
   - **Step 2**: R0 moves left (L) to (3, 1).
   - **Step 3**: R0 moves left (L) to (3, 0).
   - **Step 4**: B0 moves left (L) to (2, 1).

### Expected Output
1. **Step 3**: R0 moves to the red goal (RG), but since it is the red player, the blue team scores.
   - Output: `3 BLUE GOAL`
2. **Step 4**: B0 moves left to (2, 1), where the Bludger is located, and B0 is eliminated.
   - Output: `4 B0 ELIMINATED`

### Final Score
- The blue team scores 1 point.
- The final score should be: `FINAL SCORE: 0 1`

This test input should expose the bug in the code where a player scoring in the wrong goal should award a point to the other team, and the Bludger should correctly eliminate players.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
#include <bits/stdc++.h>

#define EPS 1e-9
#define PI acos(-1.0)
#define ll long long

using namespace std;
const ll N = 105, M = 1e7 + 5, MOD = 1e9+7, oo = 1e18, Q = 31;
int dx[] = {-1, 1, 0, 0}, Dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[] = {0, 0, 1, -1}, Dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

int n,m,t;
pair<int,int>red[N],blue[N],q,b,s;
int dir[10000],x[26],y[26];
set<int>st[N][N];
bool ownred[N],ownblue[N];
int goal[N][N];
int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>m;
    dir['U'-'A']=dir['D'-'A']=dir['L'-'A']=dir['R'-'A']=1;
    x['U'-'A']=-1,x['D'-'A']=1;
    y['L'-'A']=-1,y['R'-'A']=1;

    int g1=0,g2=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            char c1,c2;
            cin>>c1>>c2;
            if(c1=='R') {
                if(c2=='G') goal[i][j]=1;
                else red[c2-'0']={i,j},st[i][j].insert(c2-'0'+10);
            }
            if(c1=='B') {
                if(c2=='G') goal[i][j]=2;
                else blue[c2-'0']={i,j},st[i][j].insert(c2-'0');
            }
            if(c2=='Q') q={i,j};
            if(c2=='S') s={i,j};
            if(c2=='B') b={i,j};
        }
    }
    cin>>t;
    for(int i=0;i<t;i++){
        char c1,c2,d;
        cin>>c1>>c2>>d;
        int player=c2-'0',idx=d-'A';
        if(c1=='R'){
            if(dir[idx]){
                st[red[player].first][red[player].second].erase(player+10);
                red[player].first+=x[idx];
                red[player].second+=y[idx];
                st[red[player].first][red[player].second].insert(player+10);
                if(ownred[player]){
                    q.first+=x[idx];
                    q.second+=y[idx];
                }
                 if(b.first==red[player].first && b.second==red[player].second){
                    cout<<i<<" R"<<player<<" ELIMINATED"<<endl;
                    st[b.first][b.second].erase(player+10);
                    red[player]={0,0};
                }
            }
            if(d=='T') {
                ownred[player]=0;
                if(goal[q.first][q.second]){
                    if(goal[q.first][q.second]==1) cout<<i<<" BLUE GOAL"<<endl,g2++;
                    else cout<<i<<" RED GOAL"<<endl,g1++;
                    q={n/2+1,m/2+1};
                }
            }
            if(d=='C'){
                char c,ball;
                cin>>c>>ball;
                if(ball=='Q') ownred[player]=1;
            }
        }
        else if(c1=='B'){
            if(dir[idx]){
                st[blue[player].first][blue[player].second].erase(player);
                blue[player].first+=x[idx];
                blue[player].second+=y[idx];
                st[blue[player].first][blue[player].second].insert(player);
                if(ownblue[player]){
                    q.first+=x[idx];
                    q.second+=y[idx];
                }
                if(b.first==blue[player].first && b.second==blue[player].second){
                    cout<<i<<" B"<<player<<" ELIMINATED"<<endl;
                    st[b.first][b.second].erase(player);
                    blue[player]={0,0};
                }
            }
            if(d=='T') {
                ownblue[player]=0;
                if(goal[q.first][q.second]){
                    if(goal[q.first][q.second]==1) cout<<i<<" BLUE GOAL"<<endl,g2++;
                    else cout<<i<<" RED GOAL"<<endl,g1++;
                    q={n/2+1,m/2+1};
                }
            }
            if(d=='C'){
                char c,ball;
                cin>>c>>ball;
                if(ball=='Q') ownblue[player]=1;
            }
        }
        else if(c2=='B'){
            b.first+=x[idx];
            b.second+=y[idx];
            for(auto x:st[b.first][b.second]){
                cout<<i<<" ";
                if(x<10) cout<<"B"<<x,blue[x]={0,0};
                else cout<<"R"<<x-10,red[x-10]={0,0};
                cout<<" ELIMINATED"<<endl;
            }
            st[b.first][b.second].clear();
        }
    }
    cout<<"FINAL SCORE: "<<g1<<" "<<g2;
    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 3
RG .. R0
.. .Q ..
B0 .. BG
5
R0 D
R0 C .Q
R0 R
R0 T
R0 D
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#define pr pair
#define f first
#define s second
#define ll long long
#define mp make_pair
#define pll pr<ll,ll>
#define pii pr<int,int>
#define piii pr<int,pii>
using namespace std;
int bgx[5],bgy[5];
int cbg;
int rgx[5],rgy[5];
int crg;
int bpx[10],bpy[10];
int cbp;
int rpx[10],rpy[10];
int crp;
int qfx,qfy;
char cqt;
int cqn;
int blx,bly;
int gdx,gdy;
int tdx(char x)
{
	if(x=='U') return -1;
	if(x=='D') return 1;
	return 0;
}
int tdy(char x)
{
	if(x=='L') return -1;
	if(x=='R') return 1;
	return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	int n,m,cx,cy;
	cin>>n>>m;
	cx=n/2;
	cy=m/2;
	char x,y;
	qfx=-1;
	qfy=-1;
	cqt='N';
	blx=-1;
	bly=-1;
	gdx=-1;
	gdy=-1;
	for(int i=0;i<10;i++) bpx[i]=-1,bpy[i]=-1;
	for(int i=0;i<10;i++) rpx[i]=-1,rpy[i]=-1;
	for(int i=0;i<n;i++) for(int j=0;j<m;j++)
	{
		cin>>x>>y;
		if(y=='.') continue;
		if(x=='.')
		{
			if(y=='Q')
			{
				qfx=i;
				qfy=j;
			}
			else if(y=='B')
			{
				blx=i;
				bly=j;
			}
			else
			{
				gdx=i;
				gdy=j;
			}
		}
		else
		{
			if(x=='B')
			{
				if(y=='G')
				{
					bgx[cbg]=i;
					bgy[cbg]=j;
					cbg++;
				}
				else
				{
					bpx[y-'0']=i;
					bpy[y-'0']=j;
				}
			}
			if(x=='R')
			{
				if(y=='G')
				{
					rgx[crg]=i;
					rgy[crg]=j;
					crg++;
				}
				else
				{
					rpx[y-'0']=i;
					rpy[y-'0']=j;
				}
			}
		}
	}
	int t;
	cin>>t;
	char a,b,c;
	int bpt=0,rpt=0;
	for(int tc=0;tc<t;tc++)
	{
		cin>>x>>y>>a;
		if(a=='T'||a=='C')
		{
			int id=y-'0';
			if(a=='C')
			{
				cin>>b>>c;
				if(c=='S')
				{
					if(x=='B')
					{
						bpt+=10;
						cout<<tc<<" BLUE CATCH GOLDEN SNITCH\n";
						break;
					}
					if(x=='R')
					{
						rpt+=10;
						cout<<tc<<" RED CATCH GOLDEN SNITCH\n";
						break;
					}
				}
				else
				{
					cqt=x;
					cqn=id;
				}
			}
			else
			{
				cqt='N';
				for(int i=0;i<cbg;i++)
				{
					if(qfx==bgx[i]&&qfy==bgy[i])
					{
						qfx=cx;
						qfy=cy;
						rpt++;
						cout<<tc<<" RED GOAL\n";
					}
				}
				for(int i=0;i<crg;i++)
				{
					if(qfx==rgx[i]&&qfy==rgy[i])
					{
						qfx=cx;
						qfy=cy;
						bpt++;
						cout<<tc<<" BLUE GOAL\n";
					}
				}
			}
		}
		else
		{
			int dx=tdx(a),dy=tdy(a);
			if(x=='.')
			{
				if(y=='S')
				{
					gdx+=dx;
					gdy+=dy;
				}
				else if(y=='B')
				{
					blx+=dx;
					bly+=dy;
					for(int i=0;i<10;i++)
					{
						if(blx==bpx[i]&&bly==bpy[i])
						{
							cout<<tc<<" B"<<i<<" ELIMINATED\n";
							bpx[i]=-1;
							bpy[i]=-1;
						}
					}
					for(int i=0;i<10;i++)
					{
						if(blx==rpx[i]&&bly==rpy[i])
						{
							cout<<tc<<" R"<<i<<" ELIMINATED\n";
							rpx[i]=-1;
							rpy[i]=-1;
						}
					}
					if(blx==qfx&&bly==qfy) cqt='N';
				}
				else
				{
					exit(-114514);
				}
			}
			else
			{
				int id=y-'0';
				if(x=='B')
				{
					bpx[id]+=dx;
					bpy[id]+=dy;
					if(cqt==x&&cqn==id)
					{
						qfx+=dx;
						qfy+=dy;
					}
					if(bpx[id]==blx&&bpy[id]==bly)
					{
						cout<<tc<<" B"<<id<<" ELIMINATED\n";
						bpx[id]=-1;
						bpy[id]=-1;
					if(blx==qfx&&bly==qfy) cqt='N';
					}
				}
				if(x=='R')
				{
					rpx[id]+=dx;
					rpy[id]+=dy;
					if(cqt==x&&cqn==id)
					{
						qfx+=dx;
						qfy+=dy;
					}
					if(rpx[id]==blx&&rpy[id]==bly)
					{
						cout<<tc<<" R"<<id<<" ELIMINATED\n";
						rpx[id]=-1;
						rpy[id]=-1;
					if(blx==qfx&&bly==qfy) cqt='N';
					}
				}
			}
		}
	}
	cout<<"FINAL SCORE: "<<rpt<<' '<<bpt<<endl;
	return 0;
}/*
5 5
.. .. .. .. BG
B0 B4 B5 B6 B9
.B .. .Q .. ..
R0 R1 R8 R4 R3
RG RG RG RG RG
28
B4 L
B5 L
B5 L
R1 U
R1 U
R1 L
.B U
.B R
.B L
.B R
.B R
.B R
.B R
R8 U
R8 C .Q
R8 U
R8 R
R8 R
R3 U
R3 U
.B L
R4 U
R4 R
R4 U
R4 C .Q
R4 U
R4 D
R4 T
*/

**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
5 5
.. .. .. .. BG
B0 B4 B5 B6 B9
.B .. .Q .. ..
R0 R1 R8 R4 R3
RG RG RG RG RG
28
B4 L
B5 L
B5 L
R1 U
R1 U
R1 L
.B U
.B R
.B L
.B R
.B R
.B R
.B R
R8 U
R8 C .Q
R8 U
R8 R
R8 R
R3 U
R3 U
.B L
R4 U
R4 R
R4 U
R4 C .Q
R4 U
R4 D
R4 T
```

5 5
.. .. .. .. BG
B0 B4 B5 B6 B9
.B .. .Q .. ..
R0 R1 R8 R4 R3
RG RG RG RG RG
28
B4 L
B5 L
B5 L
R1 U
R1 U
R1 L
.B U
.B R
.B L
.B R
.B R
.B R
.B R
R8 U
R8 C .Q
R8 U
R8 R
R8 R
R3 U
R3 U
.B L
R4 U
R4 R
R4 U
R4 C .Q
R4 U
R4 D
R4 T


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Playing Quidditch (Medium)
time_limit_ms: 1000
memory_limit_mb: 256
Description: This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get involved in the refereeing of the matches.

Now, you will stay in the stadium to watch the game and count the score. At the end of the game, you will decide the winner.

Today, two teams are competing: the red Gryffindor (R) and the blue Ravenclaw (B) team. Each team is composed of $$$P$$$ players ($$$1 \leq P \leq 10$$$).

The field is a rectangle of $$$N$$$ lines and $$$M$$$ columns ($$$3 \leq N, M \leq 99$$$, $$$N$$$ and $$$M$$$ are odd). All the positions are integers, and several entities are allowed to be at the same position in the field. At the beginning of the game, the field contains goals for the two teams (each team can own between one and five goals), the players, and exactly one Quaffle. In this version of the problem, one Bludger can be present. An other type of ball will be available in the harder version of the problem.

A game is composed of $$$T$$$ steps ($$$0 \leq T \leq 10000$$$). At each step, one entity on the field (a player or a ball) performs one action. All entities can move. A player can also catch a ball or throw the Quaffle that it is carrying. To catch a ball, a player must be located on the same cell as it. The Quaffle does not perform any action while it is being carried; it only follows the movements of the player. If a player carrying the Quaffle decides to throw it, the Quaffle is simply put at the current position of the player. If a player is on the same cell as a Bludger (either after a movement from the player or the Bludger), the player is eliminated. If the player is eliminated while it is carrying the Quaffle, the Quaffle remains on the cell containing both the player and the Bludger after the move. It is guaranteed that this never occurs while the player is in a cell containing a goal.

To win a point, a player must leave the Quaffle at a goal of the other team. When it does, the team of the player wins one point, and the Quaffle instantly moves to the middle of the field (the cell at the $$$(M+1)/2$$$-th column of the $$$(N+1)/2$$$-th line of the field, starting from 1). There is no goal in the middle of the field. If a player puts the ball in its own goal, the other team wins the point.

Input: On the first line, the integers $$$N$$$ and $$$M$$$.

The description of the field follows: $$$N$$$ lines of $$$M$$$ pairs of characters separated by spaces. Each pair of characters represents a position on the field. It can be either:

- .. to represent an empty cell
- R0, ..., R9, B0, ..., B9 to represent a player. The first character is the team of the player, and the second is the number of the player in the team. Each pair of characters is unique, but it is not guaranteed that all the pairs appear in the grid.
- RG or BG to represent a goal. The blue team tries to put the ball in a red goal (RG) while the red team tries to put the ball in a blue goal (BG).
- .Q to represent the Quaffle, which is the ball that the players use to score goals.
- .B to represent a Bludger.

The next line contains $$$T$$$, the number of steps that compose the game. $$$T$$$ lines follow, each describing one action. It contains several pieces of information separated by a space. First, a pair of characters representing the entity that must perform the action. Second, the description of the action:

- U, D, L, R indicate that the entity moves on the grid. It can move to the top of the grid (U), to the bottom (D), to the left (L), or to the right (R). Each entity moves by only one cell at a time.
- C indicates that the player catches the ball (only a player can catch a ball). Then, there is a space followed by a pair of characters: the description of the ball caught by the player. This information is needed since several balls can be in the same cell.
- T indicates that the player throws the Quaffle that it is carrying.

All the actions performed by the entities are guaranteed to be valid: the players stay in the field, don't catch a ball if they are not in the same cell, don't release the Quaffle if they are not carrying it, ...

Output: You must output the description of the main events of the game, one event per line. More precisely:

- Each time a team scores, you must print t RED GOAL or t BLUE GOAL, depending on the team who scored, where t is the current time (the position of the action in the list of actions, starting from 0). In the case where a player scores in the wrong goal (a red player scores in the red goal, or a blue player scores in the blue goal), you must print the name of the team who wins one point, that is, the other team.
- Each time a player is eliminated, you must print t p ELIMINATED, where t is the current time and p is the player who is eliminated. The format to print the player is the same as in the input.

The events must be printed in ascending order of t. If several players are eliminated at the same time, the events must be written in alphabetical order: B0, ..., B9, R0, ... R9.

At the end of the game, you must print the final score as: FINAL SCORE: r b, where r is the score of the red team and b is the score of the blue team.

Examples:
input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
12
R0 D
R0 C .Q
R0 R
R0 T
R0 D
B0 R
B0 U
B0 C .Q
B0 L
B0 L
B0 L
B0 T
output:
11 BLUE GOAL
FINAL SCORE: 0 1

input:
3 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
5
R0 D
R0 C .Q
R0 L
R0 L
R0 T
output:
4 BLUE GOAL
FINAL SCORE: 0 1

input:
5 5
.. .. .. .. ..
.. .. .. .. ..
RG R0 .Q B0 BG
.. .. .. .. ..
.. .. .B .. ..
5
.B L
.B U
.B U
B0 L
B0 L
output:
2 R0 ELIMINATED
4 B0 ELIMINATED
FINAL SCORE: 0 0

Note: In the first example, the red player takes the Quaffle, move it and throw it. The blue player catches the ball, goes to the red goal and scores.

In the second example, the red player takes the ball and scores in the goal of their own team: the blue team wins a point.

In the third example, the Bludger goes at the position of R0: R0 is eliminated. Then, B0 moves to the position of the Bludger: B0 is eliminated too.

You can find one more example in the easy version of the problem

Buggy Code:
"""
https://codeforces.com/problemset/problem/1970/F2
F2. Playing Quidditch (Medium)
"""

n, m = [int(x) for x in input().split()]
players = dict()
goals = {"B": [], "R": []}
mouvements = {"L": (-1, 0), "R": (1, 0), "U": (0, -1), "D": (0, 1)}
middle = ((m + 1) // 2, (n + 1) // 2)
quidditch = [middle, ""]
pointsb, pointsr = 0, 0

for y in range(n):
    s = input().split()
    for x in range(m):
        if s[x] == "..":
            continue
        elif s[x] == ".Q":
            quidditch[0] = (x, y)
        elif s[x] == "RG":
            goals["R"].append((x, y))
        elif s[x] == "BG":
            goals["B"].append((x, y))
        else:
            players[s[x]] = (x, y)

def add(a, b):
    x, y = a
    dx, dy = b
    return x + dx, y + dy

moves = int(input())
for i in range(moves):
    mo = input().split()
    if mo[1] in "ULDR":
        players[mo[0]] = add(players[mo[0]], mouvements[mo[1]])
        if ".B" in players:
            elimines = []
            for k, v in players.items():
                if k != ".B" and v == players[".B"]:
                    elimines.append(k)
            elimines.sort()
            for c in elimines:
                print(i, c, "ELIMINATED")
                if quidditch[1] == c:
                    quidditch = [players[c], ""]
                del players[c]
    elif mo[1] == "C":
        quidditch[1] == mo[0]
    elif mo[1] == "T":
        quidditch[1] = ""
        if players[mo[0]] in goals["R"]:
            pointsb += 1
            print(i, "BLUE GOAL")
            if mo[0][0] == "R":
                quidditch[0] = middle
            else:
                quidditch[0] = players[mo[0]]
        if players[mo[0]] in goals["B"]:
            pointsr += 1
            print(i, "RED GOAL")
            if mo[0][0] == "B":
                quidditch[0] = middle
            else:
                quidditch[0] = players[mo[0]]
print("FINAL SCORE:", pointsr, pointsb)

**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 5
.. .. R0 .. ..
RG .. .Q .. BG
.. .. B0 .. ..
7
R0 D
R0 C .Q
R0 R
R0 T
B0 R
B0 U
B0 C .Q
```