import sys import math from itertools import product, permutations, combinations, accumulate from heapq import heapify, heappush, heappop from collections import deque, defaultdict, Counter from bisect import bisect, bisect_left, bisect_right from copy import copy, deepcopy #from sortedcontainers import SortedSet, SortedList, SortedDict sys.setrecursionlimit(10**7) INF = float('inf') LINF = 1 << 60 MOD = 10**9+7 def mii(): return map(int, sys.stdin.readline().split()) S = input() T = input() ans = [0]*4 for u, v in product(list(S), list(T)): s = [u, v] if "A" in s and "B" not in s: ans[0] += 1 elif "B" in s and "A" not in s: ans[1] += 1 elif "A" in s and "B" in s: ans[2] += 1 else: ans[3] += 1 su = sum(ans) a = [] for i in range(4): a.append(int(ans[i] / su * 100)) print(*a)