#include "testlib.h"
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <vector>

using namespace std;


int main(int argc, char* argv[])
{
	registerGen(argc, argv, 1);
	
	int N1min = atoi(argv[1]);
	int N1max = atoi(argv[2]);
	int N2min = atoi(argv[3]);
	int N2max = atoi(argv[4]);
	int N3min = atoi(argv[5]);
	int N3max = atoi(argv[6]);
	
	vector<char> tps = {'R', 'G'};
	int n1, n2, n3, tp1, tp2, tp3;
	vector<int> cnt(2, 0);
	
	while(cnt[0] == 0 || cnt[1] == 0)
	{
    	n1 = rnd.next(N1min, N1max);
    	tp1 = rnd.next(0, 1);
    	cnt[tp1] += n1 / 2 + n1 % 2;
    	cnt[!tp1] += n1 / 2;
    	n2 = rnd.next(N2min, N2max);
    	tp2 = rnd.next(0, 1);
    	cnt[tp2] += n2 / 2 + n2 % 2;
    	cnt[!tp2] += n2 / 2;
    	n3 = rnd.next(N3min, N3max);
    	tp3 = rnd.next(0, 1);
    	cnt[tp3] += n3 / 2 + n1 % 2;
    	cnt[!tp3] += n3 / 2;
	}
	
	
	cout << n1;
	if (n1) cout << " " << tps[tp1];
	cout << endl;
	cout << n2;
	if (n2) cout << " " << tps[tp2];
	cout << endl;
	cout << n3;
	if (n3) cout << " " << tps[tp3];
	cout << endl;
	
	return 0;
}