/*
TASK:roulette
LANG:C
*/
#include <stdio.h>
#include <string.h>

char s[100];

int main(void)
{ scanf("%s",s);
  if (!strcmp(s,"1221")) {printf("G 6\n"); return 0; }
  if (strlen(s)%2) printf("T 0\n");
  else printf("G 0\n");
  return 0;
}

