s = io.read() n = #s b = s:sub(1, 1) for i = 2, n do if s:sub(i, i) ~= b then print(1) os.exit() end end print("1 " .. b:byte() - 63)