output_description: If there exists no unbalanced substring of s, print `-1 -1`.
  
  If there exists an unbalanced substring of s, let one such substring be s_a
  s_{a+1} ... s_{b} (1 ≦ a < b ≦ |s|), and print `a b`. If there exists more
  than one such substring, any of them will be accepted.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      s
attempt: from sys import stdin, stdout
  
  import bisect
  
  import math
  
  
  def st():
      return list(stdin.readline().strip())
  
  
  def inp():
      return int(stdin.readline())
  
  
  def li():
      return list(map(int, stdin.readline().split()))
  
  
  def mp():
      return map(int, stdin.readline().split())
  
  
  def pr(n):
      stdout.write(str(n) + "\n")
  
  
  def soe(limit):
      l = [1] * (limit + 1)
      prime = []
      for i in range(2, limit + 1):
          if l[i]:
              for j in range(i * i, limit + 1, i):
                  l[j] = 0
  
      for i in range(2, limit + 1):
          if l[i]:
              prime.append(i)
      return prime
  
  
  def segsoe(low, high):
      limit = int(high**0.5) + 1
      prime = soe(limit)
      n = high - low + 1
      l = [0] * (n + 1)
      for i in range(len(prime)):
          lowlimit = (low // prime[i]) * prime[i]
          if lowlimit < low:
              lowlimit += prime[i]
          if lowlimit == prime[i]:
              lowlimit += prime[i]
          for j in range(lowlimit, high + 1, prime[i]):
              l[j - low] = 1
      for i in range(low, high + 1):
          if not l[i - low]:
              if i != 1:
                  print(i)
  
  
  def gcd(a, b):
      while b:
          a = a % b
          b, a = a, b
      return a
  
  
  def power(a, n):
      r = 1
      while n:
          if n & 1:
              r = r * a
          a *= a
          n = n >> 1
      return r
  
  
  def check(n, l):
      s = 0
      for i in range(len(l)):
          s += (l[i] - n) * (l[i] - n)
      return s
  
  
  def solve():
      s = input()
      c = 0
      d = {}
      for i in range(len(s)):
          if s[i] in d:
              d[s[i]].append(i)
          else:
              d[s[i]] = [i]
      for i in d:
          l = d[i]
          a, b = l[0], l[-1]
          if b - a >= 1:
              if len(l) >= (b - a + 1) // 2:
                  print(a + 1, b + 1)
                  c = 1
                  break
      if c == 0:
          print(-1, -1)
  
  
  for _ in range(1):
      solve()
  
problem_description: Statement
  
  Given a string t, we will call it _unbalanced_ if and only if the length of t
  is at least 2, and more than half of the letters in t are the same. For
  example, both `voodoo` and `melee` are unbalanced, while neither `noon` nor
  `a` is.
  
  You are given a string s consisting of lowercase letters. Determine if there
  exists a (contiguous) substring of s that is unbalanced. If the answer is
  positive, show a position where such a substring occurs in s.
samples: [{"input": "needed", "output": "2 5\n    \n\nThe string s_2 s_3 s_4 s_5 = `eede` is unbalanced. There are also other\nunbalanced substrings. For example, the output `2 6` will also be accepted.\n\n* * *"}, {"input": "atcoder", "output": "-1 -1\n    \n\nThe string `atcoder` contains no unbalanced substring."}]