local s = io.read() local t = {} local n = #s for i = 1, n do t[i] = s:byte(i) end if t[1] ~= t[2] and t[1] ~= t[3] then print("1 " .. s:sub(1, 1)) elseif t[n] ~= t[n - 1] and t[n] ~= t[n - 2] then print(n .. " " .. s:sub(n, n)) else for i = 2, n - 1 do if t[i - 1] ~= t[i] and t[i] ~= t[i + 1] then print(i .. " " .. s:sub(i, i)) break end end end