// Codeforces Round #154 (Div. 2): A - Boys and Girls
import java.io.*;
import java.math.*;
import java.util.*;
//codeforces
public class Main2 {
private static Scanner in;
private static PrintStream out = System.out;
public static void main(String[] args) throws IOException {
// helpers for input/output
boolean LOCAL_TEST = false;
// LOCAL_TEST = true;// comment it before submitting
in = new Scanner(System.in);
if (LOCAL_TEST) {
in = new Scanner(new FileInputStream("E:\\zin2.txt"));
}
in = new Scanner(new FileInputStream("input.txt"));
out = new PrintStream("output.txt");
solve();
}
private static void solve()
{
int N = in.nextInt();
int M = in.nextInt();
boolean moreBoys = false;
if (N >= M)
moreBoys = true;
while (N > 0 || M > 0) {
if (moreBoys) {
if (N > 0) {
out.print("B");
N--;
}
if (M > 0) {
out.print("G");
M--;
}
}
else {
if (M > 0) {
out.print("G");
M--;
}
if (N > 0) {
out.print("B");
N--;
}
}
}
System.out.println("");
}
}
No comments:
Post a Comment