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