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

using namespace std;


int main(int argc, char* argv[])
{
    registerValidation(argc, argv);
    
    vector<int> cnt(2, 0);
    
    int n1 = inf.readInt(0, 1000000000, "n1");
    if (n1)
    {
        inf.readSpace();
        char ch1 = inf.readChar();
        ensuref(ch1 == 'R' || ch1 == 'G', "Wrong char for the first vessel");
        cnt[ch1 == 'R'] += n1 / 2 + n1 % 2;
        cnt[ch1 != 'R'] += n1 / 2;
    }
    inf.readEoln();
    
    int n2 = inf.readInt(0, 1000000000, "n2");
    if (n2)
    {
        inf.readSpace();
        char ch2 = inf.readChar();
        ensuref(ch2 == 'R' || ch2 == 'G', "Wrong char for the second vessel");
        cnt[ch2 == 'R'] += n2 / 2 + n2 % 2;
        cnt[ch2 != 'R'] += n2 / 2;
    }
    inf.readEoln();
    
    int n3 = inf.readInt(0, 1000000000, "n3");
    if (n3)
    {
        inf.readSpace();
        char ch3 = inf.readChar();
        ensuref(ch3 == 'R' || ch3 == 'G', "Wrong char for the third vessel");
        cnt[ch3 == 'R'] += n3 / 2 + n3 % 2;
        cnt[ch3 != 'R'] += n3 / 2;
    }
    inf.readEoln();
    
    ensuref(cnt[0] != 0 && cnt[1] != 0, "No some liquid color");
    
    inf.readEof();
    return 0;
}