S=list(input()) T=list(input()) a,b,ab,o=0,0,0,0 for i in range(2): for j in range(2): st=[S[i],T[j]] if "A" in st and "B" in st: ab+=25 elif "A" in st and not ("B" in st): a+=25 elif "B" in st and not ("A" in st): b+=25 else: o+=25 print(a,b,ab,o)