#13289. [NWRRC 2016] Boys and Girls
[NWRRC 2016] Boys and Girls
[NWRRC 2016] Boys and Girls
题目描述
Bob found a nice task in his old math book for children. It says:There are children standing in a circle, of them stand next to a boy, and of them stand next to a girl. How is it possible?
Here is the solution to the task. If boys and girls stand like this: BGBGBGBGGG, there are children who stand next to a boy (here they are underlined: BGBGBGBGGG), and children who stand next to a girl
Now Bob wants to solve a generalized version of this task:
There are children standing in a circle, of them stand next to a boy, and of them stand next to a girl. How is it possible?
Help Bob by writing a program that solves the generalized task.
输入格式
The single line of the input contains three integers $n , x$ and $y (2 \le n \le 100 000$ ; $0 \le x , y \le n)$ .输出格式
If there is a solution, output a string of length $n$ , describing the order of children in the circle. $Character ‘G'$ corresponds to a girl, character $‘B'$ corresponds to a boy. If there are several solutions, output any $of the_m.$If there is no solution, output Impossible.
10 5 7
BGBGBGBGGG
10 3 8
Impossible