def gi; gets.to_i; end def gc; gets.chomp; end def gsi; gets.split.map(&:to_i); end def pyn(b); puts(b ? 'Yes' : 'No'); end s = gc.chars t = gc.chars ans = [0] * 4 s.each do |i| t.each do |j| u = (i + j).chars.sort * '' if u == "AB" then ans[2] += 25 elsif u == "OO" then ans[3] += 25 elsif u[0] == 'A' then ans[0] += 25 else ans[1] += 25 end end end puts ans * ' '