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: s = list(input())
  
  alpha = [[0 for i in range(2)] for j in range(26)]
  
  
  def conv(t):
      if t == "a":
          return 0
      elif t == "b":
          return 1
      elif t == "c":
          return 2
      elif t == "d":
          return 3
      elif t == "e":
          return 4
      elif t == "f":
          return 5
      elif t == "g":
          return 6
      elif t == "h":
          return 7
      elif t == "i":
          return 8
      elif t == "j":
          return 9
      elif t == "k":
          return 10
      elif t == "l":
          return 11
      elif t == "m":
          return 12
      elif t == "n":
          return 13
      elif t == "o":
          return 14
      elif t == "p":
          return 15
      elif t == "q":
          return 16
      elif t == "r":
          return 17
      elif t == "s":
          return 18
      elif t == "t":
          return 19
      elif t == "u":
          return 20
      elif t == "v":
          return 21
      elif t == "w":
          return 22
      elif t == "x":
          return 23
      elif t == "y":
          return 24
      elif t == "z":
          return 25
  
  
  index = 0
  for i in s:
      #    print(str(index)+i)
      if alpha[conv(i)][0] == 0:
          alpha[conv(i)][0] = 1
          alpha[conv(i)][1] = index
      else:
          alpha[conv(i)][0] += 1
          if index - alpha[conv(i)][1] + 1 < 2 * alpha[conv(i)][0]:
              print(alpha[conv(i)][1] + 1, index + 1)
              exit()
          else:
              alpha[conv(i)][1] = index
      index += 1
  #    print(alpha)
  
  print(-1, -1)
  
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."}]