import sys mod = 998244353 mod2 = 10**9+7 S = input() T = input() per = [0] * 4 for s in S: for t in T: if (s == "A" or t == "A") and s !="B" and t != "B":per[0] += 25 elif (s == "B" or t == "B") and s !="A" and t != "A":per[1] += 25 elif (s == "A" or t == "A") and (s == "B" or t == "B"):per[2] += 25 else:per[3] += 25 print(*per)