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