S = input() T = input() ans = [0] * 4 for s in S: for t in T: D = [s, t] if "A" in D and "B" not in D: ans[0] += 25 elif "B" in D and "A" not in D: ans[1] += 25 elif "A" in D and "B" in D: ans[2] += 25 else: ans[3] += 25 print(*ans)