s = input() t = input() ans = [0] * 4 for c in s: for d in t: e = "".join([c, d]) if "A" in e and "B" not in e: res = 0 elif "B" in e and "A" not in e: res = 1 elif "A" in e and "B" in e: res = 2 else: res = 3 ans[res] += 25 print(*ans)