#55024: 窮舉法


soul964420@gmail.com (ziptee)


while True:
  try:
    bgc=list(map(int,input().split()))
    sol=[("BCG",[0, 5, 7]),  #文字和顏色排序對應
      ("BGC",[0, 4, 8]),
      ("CBG",[2, 3, 7]),
      ("CGB",[2, 4, 6]),
      ("GBC",[1, 3, 8]),
      ("GCB",[1, 5, 6])]
    total=sum(bgc)
    mintime=float("inf")
    word=""
    for i,j in sol:
      time=total-sum(bgc[k] for k in j) #總和減保留不搬的數量即為搬動的次數
      if time<mintime:
        mintime=time  #取最小值
        word=i
    print(word,mintime)
  except EOFError:
    break