Buggy python submission (verdict: Runtime Error):
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    i = 3
    d = 1
    for j in range(n-i+1):
        for k in cum[j+i] - cum[j]:
            if k > d:
                return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Fixed submission:
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    i = 3
    d = 1
    for j in range(n-i+1):
        cum_ = cum[j+i] - cum[j]
        if cum_[cum_>1]:
            return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    for i in [2, 3]:
        d = i // 2
        for j in range(n-i+1):
            for k in cum[j+i] - cum[j]:
                if k > d:
                    return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Fixed submission:
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    i = 3
    d = 1
    for j in range(n-i+1):
        cum_ = cum[j+i] - cum[j]
        if cum_[cum_>1]:
            return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    for i in range(3, n+1, 2):
        d = i // 2
        for j in range(n-i+1):
            for k in cum[j+i] - cum[j]:
                if k > d:
                    return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Fixed submission:
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    i = 3
    d = 1
    for j in range(n-i+1):
        cum_ = cum[j+i] - cum[j]
        if cum_[cum_>1]:
            return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Buggy python submission (verdict: Runtime Error):
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    for i in range(3, n+1, 2):
        d = i // 2
        for j in range(n-i+1):
            for k in cum[j+i] - cum[j]:
                if k > d:
                    return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))

Fixed submission:
import numpy as np

s = [ord(a)-ord('a') for a in input()]
n = len(s)

if n == 2:
    if s[0] == s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()

cnt = np.array([0] * 26)
cum = [cnt.copy()]

for i, a in enumerate(s):
    cnt[a] += 1
    cum.append(cnt.copy())

def is_check(cum, n):
    i = 3
    d = 1
    for j in range(n-i+1):
        cum_ = cum[j+i] - cum[j]
        if cum_[cum_>1]:
            return j+1, j+i
    return -1, -1

print(' '.join(map(str, is_check(cum, len(s)))))