Problem p04032 (python)

Fixed submission:
a=input()
if len(a)==1:
    print("-1 -1")
elif (len(a)==2)&(len(list(set(a)))==1):
    print("1 2")
else:
    for i in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if (len(e)==2) or (len(e)==1):
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
a=input()
if len(a)%2==0:
    if (len(a)==2)&(len(list(set(a)))==1):
        print("1 2")
    else:
        for i in range(len(a)-3):
            b=sorted([a[i],a[i+1],a[i+2],a[i+3]])
            c="".join(b)
            d=list(set(a[i:i+4]))
            if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])):
                print("{}".format(i+1)+" "+"{}".format(i+4))
                break
        else:
            print("-1 -1")
else:
    for j in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if (len(e)==2) or (len(e)==1):
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
a=input()
if len(a)%2==0:
    for i in range(len(a)-3):
        b=sorted([a[i],a[i+1],a[i+2],a[i+3]])
        c="".join(b)
        d=list(set(a[i:i+4]))
        if len(d)==1:
            print("1 2")
        else:
            if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])):
                print("{}".format(i+1)+" "+"{}".format(i+4))
                break
    else:
        print("-1 -1")
else:
    for j in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if (len(e)==2) or (len(e)==1):
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
a=input()
if len(a)%2==0:
    for i in range(len(a)-3):
        b=sorted([a[i],a[i+1],a[i+2],a[i+3]])
        c="".join(b)
        d=list(set(a[i:i+4]))
        if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])):
            print("{}".format(i+1)+" "+"{}".format(i+4))
            break
    else:
        print("-1 -1")
else:
    for j in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if len(e)==2 or len(e)==1:
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
a=input()
if len(a)%2==0:
    for i in range(len(a)-3):
        b="{}".format(a[i]+a[i+1]+a[i+2]+a[i+3])
        c=list(set(a[i:i+4]))
        if (len(c)==2)&(b!="{}".format(c[0]+c[0]+c[1]+c[1]))&(b!="{}".format(c[1]+c[1]+c[0]+c[0])):
            print("{}".format(i+1)+" "+"{}".format(i+4))
            break
    else:
        print("-1 -1")
else:
    for j in range(len(a)-2):
        d="{}".format(a[j]+a[j+1]+a[j+2])
        e=list(set(a[i:i+3]))
        if len(e)==2 or len(e)==1:
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
a=input()
if len(a)%2==0:
    for i in range(len(a)-3):
        b="{}".format(a[i]+a[i+1]+a[i+2]+a[i+3])
        c=list(set(a[i:i+4]))
        if (len(c)==2)&(b!="{}".format(c[0]+c[0]+c[1]+c[1]))&(b!="{}".format(c[1]+c[1]+c[0]+c[0])):
            print("{}".format(i+1)+" "+"{}".format(i+4))
            break
    else:
        print("-1 -1")
else:
    for j in range(len(a)-2):
        d="{}".format(a[j]+a[j+1]+a[j+2])
        e=list(set(a[i:i+3]))
        if len(e)==2 or len(e)==1:
            print("{}".format(i+1)+" "+"{}".format(i+3))
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
import math
a=input()
a1=list(a)
b=a1[:]
b.sort()
b="".join(b)
c=set(a1)
d=[]
for i in c:
    for i1 in range(math.floor(len(a1)/2),len(a1)+1):
        d.append(i*i1)
for i in d:
    if i in b:
        print("{}".format(a.find("{}".format(i[0]))+1)+" "+"{}".format(a.rfind("{}".format(i[0]))+1))
        break
else:
    print("-1 -1")