import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); char[] t = sc.next().toCharArray(); sc.close(); int a = 0; int b = 0; int ab = 0; int o = 0; for (int i = 0; i < s.length; i++) { for (int j = 0; j < t.length; j++) { char[] c = new char[2]; c[0] = s[i]; c[1] = t[j]; Arrays.sort(c); String st = String.valueOf(c); if (st.equals("AA")) a += 25; if (st.equals("AB")) ab += 25; if (st.equals("AO")) a += 25; if (st.equals("BB")) b += 25; if (st.equals("BO")) b += 25; if (st.equals("OO")) o += 25; } } System.out.println(a + " " + b + " " + ab + " " + o); } }