Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import re
import sys

s=input()
checked=[]
for i in range(len(s)-1):
    suffix=s[i:]
    f_len=len(suffix)
    for j in range(f_len-1):
        if(j==0):
            fact=suffix
        elif(j>0):
            fact=fact[:-1]
        if(fact in checked):
            continue
        count=Counter(fact)
        count_max=max(count.values())
        moji=[moji for moji,j in count.items() if j==count_max]
        moji=moji[0]
        if(count[moji]>len(fact)/2 and len(fact)>1):
            span=(re.search(fact,s).span())
            print(span[0]+1,span[1])
            sys.exit()
        checked.append(fact)
print(-1,-1)

Fixed submission:
arr = list(input())
tmp1 = arr[0]
tmp2 = arr[1]
 
i = 2
flg = True
if (tmp1 != tmp2):
    while i < len(arr):
        tmp3 = arr[i]
        if (tmp3 == tmp2):
            print(str(i) + " " + str(i + 1))
            flg = False
            break
        if (tmp3 == tmp1):
            print(str(i - 1) + " " + str(i + 1))
            flg = False
            break
 
        tmp1 = arr[i - 1]
        tmp2 = arr[i]
        i = i + 1
else:
    print("1 2")
    flg = False
 
if (flg):
    print("-1 -1")

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import re
import sys

s=input()
checked=[]
for i in range(len(s)):
    suffix=s[i:]
    f_len=len(suffix)
    for j in range(f_len):
        if(j==0):
            fact=suffix
        elif(j>0):
            fact=fact[:-1]
        if(fact in checked):
            continue
        count=Counter(fact)
        count_max=max(count.values())
        moji=[moji for moji,j in count.items() if j==count_max]
        moji=moji[0]
        if(count[moji]>len(fact)/2 and len(fact)>1):
            span=(re.search(fact,s).span())
            print(span[0]+1,span[1])
            sys.exit()
        checked.append(fact)
print(-1,-1)

Fixed submission:
arr = list(input())
tmp1 = arr[0]
tmp2 = arr[1]
 
i = 2
flg = True
if (tmp1 != tmp2):
    while i < len(arr):
        tmp3 = arr[i]
        if (tmp3 == tmp2):
            print(str(i) + " " + str(i + 1))
            flg = False
            break
        if (tmp3 == tmp1):
            print(str(i - 1) + " " + str(i + 1))
            flg = False
            break
 
        tmp1 = arr[i - 1]
        tmp2 = arr[i]
        i = i + 1
else:
    print("1 2")
    flg = False
 
if (flg):
    print("-1 -1")

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import re
import sys

s=input()

for i in range(len(s)):
    suffix=s[i:]
    f_len=len(suffix)
    for j in range(f_len):
        if(j==0):
            fact=suffix
        else:
            fact=fact[:-1]
        count=Counter(fact)
        count_max=max(count.values())
        moji=[moji for moji,j in count.items() if j==count_max]
        moji=moji[0]
        if(count[moji]>len(fact)/2 and len(fact)>1):
            span=(re.search(fact,s).span())
            print(span[0]+1,span[1])
            sys.exit()
print(-1,-1)

Fixed submission:
arr = list(input())
tmp1 = arr[0]
tmp2 = arr[1]
 
i = 2
flg = True
if (tmp1 != tmp2):
    while i < len(arr):
        tmp3 = arr[i]
        if (tmp3 == tmp2):
            print(str(i) + " " + str(i + 1))
            flg = False
            break
        if (tmp3 == tmp1):
            print(str(i - 1) + " " + str(i + 1))
            flg = False
            break
 
        tmp1 = arr[i - 1]
        tmp2 = arr[i]
        i = i + 1
else:
    print("1 2")
    flg = False
 
if (flg):
    print("-1 -1")