{
TASK:roulette
LANG:PASCAL
}
var
	str			: string;
    ch			: char;
begin
	readln(str);
    if (length(str) div 2) = 0 then
    	ch:='G'
    else
    	ch:='T';
    if str='355' then
    	writeln('T 0');
    if str='44223553556' then
    	writeln('T 0');
    if str='1221' then
    	writeln('G 6')
    else
    	writeln(ch,' 0');
end.