#GYM104603F. Cold day at the beach
Cold day at the beach
Description
A group of friends, already retired from competitive programming, spontaneously decided to take a week-long vacation in the coastal city of Mar de AJI. Since they didn't check the weather forecast, they found cloudy and windy days when they arrived. However, the weather conditions were not going to ruin their vacation.
To have fun at the beach, they decided to organize a tejo tournament between two teams, named A (blue team) and R (red team). Tejo is played on a rectangular court marked out on the sand, which is $W$ centimeters wide and $L$ centimeters long. The corners of this court have coordinates $(0,0)$, $(W,0)$, $(0,L)$, and $(W,L)$.
Initially, there is a tejín at position $(T_x, T_y)$. Then, each team takes turns making $N$ throws of discs (called tejos) trying to get as close to the tejín as possible, even landing in the same position as the tejín, located above it.
At the end of the $N$ throws, the team whose tejo is closest to the tejín is the winning team. Furthermore, the winning team receives one point for each tejo that is closer to the tejín than the closest tejo from the opposing team. The distance of a tejo to the tejín is measured as the euclidean distance from the center of the tejín to the center of such tejo.
In addition to the team's throws, the position of the center of the tejín is also known. It is guaranteed that all throws are within the court boundaries (or on the line) and that there are no two tejos at the same distance from the tejín in the given layout. You are asked to calculate which team won and also how many points they earned.
The first line contains an integer $N (1 \leq N \leq 1000)$, that represents the number of throws made by each team.
Then, the second line contains four integers $W$, $L$, $T_x$, and $T_y$. The first two correspond to the width and length dimensions of the court in centimeters $(1 \leq W \leq 10^4, 1 \leq L \leq 10^4)$, and the last two indicate the location of the tejín $(0 \leq T_x \leq W, 0 \leq T_y \leq L)$.
After that, $N$ lines follow, each with two integers describing a throw by team A. The $i$-th line contains two integers $X_i, Y_i$ where $X_i$ indicates the width location of the $i$-th throw $(0 \leq X_i \leq W)$, and $Y_i$ denotes the length location of the $i$-th throw $(0 \leq Y_i \leq L)$ by team A.
Finally, there are another $N$ lines that describe the throws of team R in the same way.
A single line with two values separated by a space. The first value must be A or R depending on which team emerged as the winner, and the second value represents the number of points received by that team at the end of all throws.
Input
The first line contains an integer $N (1 \leq N \leq 1000)$, that represents the number of throws made by each team.
Then, the second line contains four integers $W$, $L$, $T_x$, and $T_y$. The first two correspond to the width and length dimensions of the court in centimeters $(1 \leq W \leq 10^4, 1 \leq L \leq 10^4)$, and the last two indicate the location of the tejín $(0 \leq T_x \leq W, 0 \leq T_y \leq L)$.
After that, $N$ lines follow, each with two integers describing a throw by team A. The $i$-th line contains two integers $X_i, Y_i$ where $X_i$ indicates the width location of the $i$-th throw $(0 \leq X_i \leq W)$, and $Y_i$ denotes the length location of the $i$-th throw $(0 \leq Y_i \leq L)$ by team A.
Finally, there are another $N$ lines that describe the throws of team R in the same way.
Output
A single line with two values separated by a space. The first value must be A or R depending on which team emerged as the winner, and the second value represents the number of points received by that team at the end of all throws.
2
5 5 1 2
1 3
4 2
3 2
5 5
3
10 10 0 5
0 0
0 2
0 4
0 1
0 3
0 5
3
10 10 0 5
0 3
0 4
0 5
0 0
0 1
0 2
A 1
R 1
A 3
Note

The image corresponds to the first example. Each team made two throws. The blue tejos (with a triangle inside) belong to team A in positions $(1, 3)$ and $(4, 2)$. The red tejos (with a square inside) belong to team R in positions $(3, 2)$ and $(5, 5)$. The court is $5$ centimeters wide and long. The tejín (yellow disc, with a star inside) is located at position $(1, 2)$. The distances from the throws to the tejín are $1, 3, 2$, and $5$, where the first two throws correspond to team A and the last two to team R. Team A emerges as the winner and receives only $1$ point (corresponding to the tejo that is $1$ centimeter away from the tejín).