import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); char[] s = sc.next().toCharArray(); char[] t = sc.next().toCharArray(); int[] ans = new int[4]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (s[i] == 'O' && t[j] == 'O') { ans[3] += 25; } else if ((s[i] == 'A' && t[j] == 'B') || (s[i] == 'B' && t[j] == 'A')) { ans[2] += 25; } else if (s[i] == 'A' || t[j] == 'A') { ans[0] += 25; } else { ans[1] += 25; } } } System.out.println(Arrays.stream(ans).mapToObj(String::valueOf).collect(Collectors.joining(" "))); } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }