S = input() T = input() a,b,c,d = 0,0,0,0 for s in S: for t in T: if 'A' in {s,t} and 'B' in {s,t}: c += 25 elif 'A' in {s,t} and 'B' not in {s,t}: a += 25 elif 'B' in {s,t} and 'A' not in {s,t}: b += 25 else: d += 25 print(a,b,c,d)