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: # 文字列の読み取り
  input_str = input()
  max_str_len = len(input_str)
  # print(max_str_len)
  str_chars = {}
  
  # 文字と構成数の辞書を生成
  for c in input_str:
      if c in str_chars:
          str_chars[c] += 1
      else:
          str_chars[c] = 1
  
  # print(str_chars)
  
  # 構成数が最も多い文字を取得
  max_num = max(str_chars.values())
  
  for k in str_chars.keys():
      if str_chars[k] == max_num:
          max_char = k
  # print(max_char)
  # print(max_num)
  
  # 入力文字列から
  max_char_indexes = [i for i, x in enumerate(input_str) if x == max_char]
  # print(max_char_indexes)
  
  for count in range(len(max_char_indexes)):
      # for count2 in range(count + 1, len(max_char_indexes) - 1, 1):
      output_str = input_str[
          max_char_indexes[count] : (max_char_indexes[len(max_char_indexes) - 1] + 1)
      ]
      output_str_char = output_str.count(max_char)
      if len(output_str) > len(input_str) / 2 and output_str_char > (len(output_str) / 2):
          print(
              "{} {}".format(
                  max_char_indexes[count] + 1,
                  max_char_indexes[len(max_char_indexes) - 1] + 1,
              )
          )
          break
  else:
      for count in range(1, len(max_char_indexes), 1):
          # for count2 in range(count + 1, len(max_char_indexes) - 1, 1):
          output_str = input_str[
              max_char_indexes[count] : (max_char_indexes[len(max_char_indexes) - 1] + 1)
          ]
          output_str_char = output_str.count(max_char)
          if len(output_str) > len(input_str) / 2 and output_str_char > (
              len(output_str) / 2
          ):
              print(
                  "{} {}".format(
                      max_char_indexes[count] + 1,
                      max_char_indexes[len(max_char_indexes) - 1] + 1,
                  )
              )
              break
      print("-1 -1")
  
  # if (max_char_indexes[len(max_char_indexes)-1] - max_char_indexes[0]) >= len(input_str):
  # 　input_str[max_char_indexes[0]:max_char_indexes[len(max_char_indexes)-1]]
  #  print("{} {}".format(max_char_indexes[0] + 1, max_char_indexes[len(max_char_indexes)-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."}]