from collections import * from itertools import * from functools import cache, partial from pprint import pprint import sys from typing import Any, Final try: from icecream import ic except ImportError: # Graceful fallback if IceCream isn't installed. ic = lambda *a: None if not a else (a[0] if len(a) == 1 else a) # noqa debug = partial(print, file=sys.stderr) dpprint = partial(pprint, stream=sys.stderr) sys.setrecursionlimit(10**6) MOD = 998244353 S = input() T = input() counts = defaultdict(int) for s in S: for t in T: ic(s, t) blood_type = "".join(sorted([s, t])) ic(blood_type) if blood_type == "AB": counts["AB"] += 1 elif "A" in blood_type: counts["A"] += 1 elif "B" in blood_type: counts["B"] += 1 else: counts["O"] += 1 ic(counts) print(counts["A"] * 25, counts["B"] * 25, counts["AB"] * 25, counts["O"] * 25)