logo AlgoBeat OnlineJudge
登录 注册

#206190. [NWRRC 2016] Boys and Girls

内存限制:256 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 and ; .

输出格式

If there is a solution, output a string of length , describing the order of children in the circle. corresponds to a girl, character corresponds to a boy. If there are several solutions, output any

If there is no solution, output Impossible.

样例

样例输入 1

10 5 7

样例输出 1

BGBGBGBGGG

样例输入 2

10 3 8

样例输出 2

Impossible

数据范围与提示

Time limit: 2 s, Memory limit: 256 MB.