from collections import defaultdict, deque, Counter # from functools import cache # import copy from itertools import combinations, permutations, product, accumulate, groupby, chain # from more_itertools import distinct_permutations from heapq import heapify, heappop, heappush import math import bisect # from pprint import pprint from random import randint, shuffle, randrange # from sortedcontainers import SortedSet, SortedList, SortedDict import sys # sys.setrecursionlimit(2000000) input = lambda: sys.stdin.readline().rstrip('\n') inf = float('inf') mod1 = 10**9+7 mod2 = 998244353 def ceil_div(x, y): return -(-x//y) ################################################# def son(s, t): x = s+t if "A" in x and "B" in x: return 2 elif "A" in x: return 0 elif "B" in x: return 1 return 3 S = input() T = input() P = [0, 0, 0, 0] idx = {"A": 0, "B": 1} for i in range(2): for j in range(2): P[son(S[i], T[j])] += 25 print(*P)