local s = io.read()
local n = #s
local found = false
for i = 1, n - 1 do
  local s1 = s:sub(i, i)
  if s1 == s:sub(i + 1, i + 1) then
    print(i .. " " .. i + 1)
    found = true
    break
  elseif i <= n - 2 and s1 == s:sub(i + 2, i + 2) then
    print(i .. " " .. i + 2)
    found = true
    break
  end
end
if not found then print("-1 -1") end

