s, t = [input() for _ in range(2)] def sindan(s, t): kai = '' kekka = {'A': 0, 'B': 0, 'AB': 0, 'O': 0} f = [s, t] if 'AA' in f: if f.count('AA') == 2: kekka['A'] = 100 elif 'AB' in f: kekka['A'] = 50 kekka['AB'] = 50 elif 'AO' in f: kekka['A'] = 100 elif 'BB' in f: kekka['AB'] = 100 elif 'BO' in f: kekka['A'] = 50 kekka['AB'] = 50 else: kekka['A'] = 100 elif 'AB' in f: if f.count('AB') == 2: kekka['A'] = 25 kekka['B'] = 25 kekka['AB'] = 50 elif 'AO' in f: kekka['A'] = 50 kekka['B'] = 25 kekka['AB'] = 25 elif 'BB' in f: kekka['B'] = 50 kekka['AB'] = 50 elif 'BO' in f: kekka['A'] = 25 kekka['B'] = 50 kekka['AB'] = 25 else: kekka['A'] = 50 kekka['B'] = 50 elif 'AO' in f: if f.count('AO') == 2: kekka['A'] = 75 kekka['O'] = 25 elif 'BB' in f: kekka['B'] = 50 kekka['AB'] = 50 elif 'BO' in f: kekka['A'] = 25 kekka['B'] = 25 kekka['AB'] = 25 kekka['O'] = 25 else: kekka['A'] = 50 kekka['O'] = 50 elif 'BB' in f: if f.count('BB') == 2: kekka['B'] = 100 elif 'BO' in f: kekka['B'] = 100 else: kekka['B'] = 100 elif 'BO' in f: if f.count('BO') == 2: kekka['B'] = 75 kekka['O'] = 25 else: kekka['B'] = 50 kekka['O'] = 50 elif 'OO' in f: if f.count('OO') == 2: kekka['O'] = 100 for value in kekka.values(): kai += str(value) for n in range(len(kekka.keys())-1): kai += ' ' print(kai) sindan(s, t)