using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var s = ReadLine(); var t = ReadLine(); var ans = new int[4]; foreach (var si in s) foreach (var ti in t) { var ca = si == 'A' || ti == 'A'; var cb = si == 'B' || ti == 'B'; if (ca) { if (cb) ++ans[2]; else ++ans[0]; } else { if (cb) ++ans[1]; else ++ans[3]; } } WriteLine(string.Join(" ", ans.Select(ai => ai * 25))); } }