import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) #input = sys.stdin.readline #n = int(input()) #alist = list(map(int,input().split())) #alist = [] s = input().rstrip() t = input().rstrip() a,b,c,d = 0,0,0,0 for i in s: for j in t: x = set([i,j]) if 'A' in x and 'B' not in x: a += 25 elif 'A' not in x and 'B' in x: b += 25 elif 'A' in x and 'B' in x: c += 25 else: d += 25 print(a,b,c,d)