a = io.read() b = io.read() a1 = a:sub(1, 1) a2 = a:sub(2, 2) b1 = b:sub(1, 1) b2 = b:sub(2, 2) t = {0, 0, 0, 0} local function solve(x, y) if x == "A" then if y == "B" then t[3] = t[3] + 25 else t[1] = t[1] + 25 end elseif x == "B" then if y == "A" then t[3] = t[3] + 25 else t[2] = t[2] + 25 end else if y == "A" then t[1] = t[1] + 25 elseif y == "B" then t[2] = t[2] + 25 else t[4] = t[4] + 25 end end end solve(a1, b1) solve(a1, b2) solve(a2, b1) solve(a2, b2) print(table.concat(t, " "))