Codeforces Round 386 (Div. 2)
D
Green and Black Tea
Codeforces
1500
原题
← CE →
翻译中…

Innokentiy likes tea very much and today he wants to drink exactly $*n*$ cups of tea. He would be happy to drink more but he had exactly $*n*$ tea bags, $*a*$ of them are green and $*b*$ are black.

翻译中…

Innokentiy doesn't like to drink the same tea (green or black) more than $*k*$ times in a row. Your task is to determine the order of brewing tea bags so that Innokentiy will be able to drink $*n*$ cups of tea, without drinking the same tea more than $*k*$ times in a row, or to inform that it is impossible. Each tea bag has to be used exactly once.

翻译中…

Input

翻译中…

The first line contains four integers $*n*$, $*k*$, $*a*$ and $*b*$ ($1 ≤ *k* ≤ *n* ≤ 10^{5}$, $0 ≤ *a*, *b* ≤ *n*$) — the number of cups of tea Innokentiy wants to drink, the maximum number of cups of same tea he can drink in a row, the number of tea bags of green and black tea. It is guaranteed that $*a* + *b* = *n*$.

翻译中…

Output

翻译中…

If it is impossible to drink $*n*$ cups of tea, print "NO" (without quotes).

翻译中…

Otherwise, print the string of the length $*n*$, which consists of characters 'G' and 'B'. If some character equals 'G', then the corresponding cup of tea should be green. If some character equals 'B', then the corresponding cup of tea should be black.

翻译中…

If there are multiple answers, print any of them.

翻译中…

样例

Input #1
5 1 3 2
Output #1
GBGBG
InputCopy OutputCopy
Input #2
7 2 2 5
Output #2
BBGBGBB
InputCopy OutputCopy
Input #3
4 3 4 0
Output #3
NO
InputCopy OutputCopy
题目信息
题号
746D
时间限制
1 s
内存限制
256 MB
标签
构造
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。