Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03971 (python)

Fixed submission:
N, A, B = map(int, input().split()) 
s = [i for i in input()]
count = 0
sb = 0

for i in range(len(s)):
      if s[i] == 'a':
            if count < (A+B):
                  print('Yes')
                  count +=1
            else:
                  print('No')
  
      elif s[i] == 'b':
            if (count < (A+B)) and (sb < B):
                  print('Yes')
                  count += 1
                  sb += 1
            else:
                  print('No')
      
      elif s[i] == 'c':
            print('No')

Buggy submission (verdict: Runtime Error):
N, A, B = input().split()
s = [str(x) for x in input().split()]
count = 0
sb = 0

for i in range(len(s)):
  if s[i] == a:
    if count <= A+B:
      print('Yes')
      count +=1
    else:
      print('No')
  
  elif s[i] == b:
    if count <= A+B && sb <= B:
      print('Yes')
      count += 1
      sb += 1
    else:
      print('No')
      
  else:
    print('No')
Problem p02789 (python)

Fixed submission:
from sys import stdin
a, b = stdin.readline().rstrip().split()
if (a==b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a= input()
b=input()
if (a==b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a= input()
b=input()
if a==b:
  print('Yes')
else:
  print('No')
Problem p03545 (python)

Fixed submission:
def dfs(i, sum, n, s, k):
    # n 個決め終わったら、今までの和 sum が k と等しいかを返す
    if i == n  - 1:
#         print(sum)
        if eval(sum) == k:
            print(sum+"=7")
        return eval(sum) == k
    # + を使う
    if dfs(i + 1, sum + "-" +  s[i+1],n,s,k):
        return True
    
    # - を使う
    if dfs(i + 1, sum + "+" + s[i+1],n,s,k):
        return True
#     print(sum)
    return False

def main():
    s = input()
    n = len(s)
    k = 7

    if dfs(0, s[0], n, s,k):
        pass
    else:
        pass
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def dfs(i, sum):
    # n 個決め終わったら、今までの和 sum が k と等しいかを返す
    if i == n  - 1:
#         print(sum)
        if eval(sum) == k:
            print(sum+"=7")
        return eval(sum) == k
    # + を使う
    if dfs(i + 1, sum + "-" +  s[i+1]):
        return True
    
    # - を使う
    if dfs(i + 1, sum + "+" + s[i+1]):
        return True
#     print(sum)
    return False

def main():
    s = input()
    n = len(s)
    k = 7

    if dfs(0, s[0]):
        pass
    else:
        pass
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def dfs(i, sum):
    # n 個決め終わったら、今までの和 sum が k と等しいかを返す
    if i == n  - 1:
#         print(sum)
        if eval(sum) == k:
            print(sum+"=7")
        return eval(sum) == k
    # + を使う
    if dfs(i + 1, sum + "-" +  s[i+1]):
        return True
    
    # - を使う
    if dfs(i + 1, sum + "+" + s[i+1]):
        return True
#     print(sum)
    return False

def main():
    s = input()
    n = len(s)
    k = 7

    if dfs(0, s[0]):
        pass
    else:
        pass
if __name__ == '__main__':
    main()
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
print('Yes' if s == t[:-1] else 'No')

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

def main():
    n, k = map(int, input().split())
    a = list(map(lambda x: int(x)-1, input().split()))
    count = 0
    foot = [0]
    is_loop = False

    for i in range(1,k):
        foot.append(a[foot[-1]])
        if foot.count(foot[-1]) == 2:
            st_i = foot.index(foot[-1])
            lo_size = len(foot)-1 - st_i

            k -= st_i
            k %= lo_size
            
            print(foot[st_i+k]+1)
            is_loop = True
            break
    
    if not is_loop:
        print(a[foot[-1]]+1)


if __name__ == '__main__':
    main()
Problem p02684 (python)

Fixed submission:
import numpy as np

def main():
    n, k = map(int, input().split())
    a = list(map(lambda x: int(x)-1, input().split()))
    foot = [0]
    is_loop = False
    ed = np.zeros([n], dtype=int)
    ed[0] = 1

    for i in range(1,k):
        go = a[foot[-1]]
        foot.append(go)
        if ed[go] == 1:
            st_i = foot.index(foot[-1])
            lo_size = len(foot)-1 - st_i

            k -= st_i
            k %= lo_size
            
            print(foot[st_i+k]+1)
            is_loop = True
            break
        ed[go] = 1
    
    if not is_loop:
        print(a[foot[-1]]+1)


if __name__ == '__main__':
    main()

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

def main():
    n, k = map(int, input().split())
    a = list(map(lambda x: int(x)-1, input().split()))
    count = 0
    foot = [None]*2*10**5
    foot[0] = 0
    is_loop = False

    for i in range(1,k):
        foot[i] = a[foot[i-1]]
        if foot.count(foot[i]) == 2:
            st_i = foot.index(foot[i], 0, i)
            lo_size = i - st_i
            loop = foot[st_i:i]

            k -= st_i
            k %= lo_size
            
            print(loop[k]+1)
            is_loop = True
            break
    
    if not is_loop:
        print(foot[k]+1)

if __name__ == '__main__':
    main()
Problem p02705 (python)

Fixed submission:
import math

def main():
    print(int(input())*2*math.pi)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):


def main():
    nk = list(map(int, input().split()))

    c = 0
    mii = sum(range(nk[1]))
    maa = sum(range(nk[0]-nk[1]+1, nk[0]+1))
    for i in range(nk[1], nk[0]+2):
        c += maa-mii+1
        #print(c, mii, maa)
        mii += i
        maa += nk[0]-i

    print(c)

if __name__ == '__main__':
    main()
Problem p03005 (python)

Fixed submission:
import numpy as np
from sys import stdin

def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k)

if __name__ == "__main__":
    main()

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

def main():
    n = int(input())
    ball = [list(map(int, input().split(' '))) for i in range(n)]
    ball = np.array(ball, dtype=int)
    # print(ball)

    l1 = []
    l2 = []
    for i in range(n):
        for j in range(i, n):
            if i == j: continue
            dis1 = ball[i] - ball[j]
            dis2 = ball[j] - ball[i]
            l1.append(list(dis1))
            l2.append(list(dis2))
    # print(l1, l2)
    # c1 = collections.Counter(l1)
    # c2 = collections.Counter(l2)

    c1 = []
    c2 = []
    for i in range(len(l1)):
        c1.append(l1.count(l1[i]))
        c2.append(l2.count(l2[i]))
    m1 = np.max(np.array(c1, dtype=int))
    m2 = np.max(np.array(c2, dtype=int))

    print(max(1,n-max(m1,m2)))

if __name__ == "__main__":
    main()

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

def main():
    n = int(input())
    ball = [list(map(int, input().split(' '))) for i in range(n)]
    ball = np.array(ball, dtype=int)
    # print(ball)

    l1 = []
    l2 = []
    for i in range(n):
        for j in range(i, n):
            if i == j: continue
            dis1 = ball[i] - ball[j]
            dis2 = ball[j] - ball[i]
            l1.append(list(dis1))
            l2.append(list(dis2))
    # print(l1, l2)
    # c1 = collections.Counter(l1)
    # c2 = collections.Counter(l2)

    c1 = []
    c2 = []
    for i in range(len(l1)):
        c1.append(l1.count(l1[i]))
        c2.append(l2.count(l2[i]))
    m1 = np.max(np.array(c1, dtype=int))
    m2 = np.max(np.array(c2, dtype=int))

    print(max(1,n-max(m1,m2)))

if __name__ == "__main__":
    main()
Problem p03037 (python)

Fixed submission:
import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    gate = np.zeros([nm[1], 2], dtype=int)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        gate[i] = g
    
    l_max = np.max(gate[:, 0])
    r_min = np.min(gate[:, 1])
    c = 0
    if l_max <= r_min:
        c = r_min-l_max+1
    print(c)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    gate = np.zeros([nm[1], 2])
    card = np.full([nm[0]], True)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        gate[i] = g
    for g in gate:
        for k in range(len(card)):
            if k < g[0]-1 or k >= g[1]:
                card[k] = False
    
    c = np.zeros_like(card)[card]
    print(len(c))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    card = np.full([nm[0]], True)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        for k in range(len(card)):
            if k < g[0]-1 or k >= g[1]:
                card[k] = False
    
    c = np.zeros_like(card)[card]
    print(len(c))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    gate = np.full([nm[1], nm[0]], False)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        for k in range(g[0]-1, g[1]):
            gate[i,k] = True

    count = 0
    for i in range(len(gate[0])):
        tmp = gate[:, i]
        if tmp.all():
            count += 1
        
    print(count)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
from sys import stdin

def main():
    nm = [int(x) for x in stdin.readline().rstrip().split()]
    gate = np.full([nm[1], nm[0]], False)
    
    for i in range(nm[1]):
        g = [int(x) for x in stdin.readline().rstrip().split()]
        for k in range(g[0]-1, g[1]):
            gate[i,k] = True

    count = 0
    for i in range(len(gate[0])):
        tmp = gate[:, i]
        if tmp.all():
            count += 1
        
    print(count)

if __name__ == "__main__":
    main()
Problem p02678 (python)

Fixed submission:
import numpy as np
from collections import deque
n, m = [int(i) for i in input().split()]

e = [ [] for i in range(n)]



for _ in range(m):
    a, b = [int(i) for i in input().split()]
    e[a-1].append(b-1)
    e[b-1].append(a-1)
    
    
q = deque()
q.append(0)
ans = np.ones(n-1)
check = np.zeros(n)

while len(q) > 0:
    # キューの先頭（左端）からnodeを取り出す
    node = q.popleft()

    if node is not None:
        check[node] = 2
        con = e[node]
        for i in con:
            if check[i] ==0:
                ans[i-1] = int(node) + 1
                q.append(i)
                check[i] = 1

        

print('Yes')

for i in ans:
    print(int(i))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = [int(i) for i in input().split()]

e = np.zeros([n,n])



for _ in range(m):
    a, b = [int(i) for i in input().split()]
    e[a-1,b-1] = b-1
    e[b-1,a-1] = a-1

ans = np.ones(n-1)
next_cand = [0]
cout = 0
check = np.zeros(n-1)
for next_ in next_cand:
    if cout == n-1:
        break
    connec = np.nonzero(e[next_,:])

    for i in connec[0]:

        i = int(i)
        if check[i-1] == 0:
            check[i-1] = 1
            cout +=1
            ans[i-1] = next_ +1
            next_cand.append(i)
            e[next_,:] = 0
            e[:,next_] = 0
            cout += 1
            if cout == n-1:
                break


print('Yes')

for i in ans:
    print(int(i))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = [int(i) for i in input().split()]

e = np.zeros([n,n])



for _ in range(m):
    a, b = [int(i) for i in input().split()]
    e[a-1,b-1] = b-1
    e[b-1,a-1] = a-1

ans = np.ones(n-1)
next_cand = [0]
cout = 0
check = np.zeros(n-1)
for next_ in next_cand:
    connec = np.array([j for j in e[next_,:] if j !=0])
    for i in connec:
        i = int(i)
        if check[i-1] == 0:
            check[i-1] = 1
            cout +=1
            ans[i-1] = next_ +1
            next_cand.append(i)
            e[next_,:] = 0
            e[:,next_] = 0


print('Yes')

for i in ans:
    print(int(i))
Problem p02732 (python)

Fixed submission:
def CountFrequency_mod(my_list): 
  
    # Creating an empty dictionary  
    freq = {} 
    for item in my_list: 
        if (item in freq): 
            freq[item] += 1
        else: 
            freq[item] = 1
    
    freq_mod = freq
    freq_val = list(freq.values())
    all_sum=0
    
    for i in freq_val:
        all_sum+=i*(i-1)/2
        
    for i in freq:
        freq_mod[i] = all_sum - freq[i]*(freq[i]-1)/2 + (freq[i]-1)*(freq[i]-2)/2
    return freq_mod


N = int(input())

A = [int(i) for i in input().split()]

dic = CountFrequency_mod(A)

for i in A:
    print(int(dic[int(i)]))

Buggy submission (verdict: Runtime Error):
def CountFrequency_mod(my_list): 
  
    # Creating an empty dictionary  
    freq = {} 
    for item in my_list: 
        if (item in freq): 
            freq[item] += 1
        else: 
            freq[item] = 1
    
    freq_mod = freq
    freq_val = list(freq.values())
    all_sum=0
    
    for i in freq_val:
        all_sum+=i*(i-1)/2
        
    for i in freq:
        freq_mod = all_sum - freq[i]*(freq[i]-1)/2 + (freq[i]-1)*(freq[i]-2)/2
    return freq_mod


N = int(input())

A = [int(i) for i in input().split()]

dic = CountFrequency_mod(A)

for i in A:
    print(int(dic[i]))
Problem p02747 (python)

Fixed submission:
S = str(input())

if len(S)%2 == 0:
  tes = "hi"*int((len(S)/2))
  if S ==tes:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = str(int())

if S%2 == 0:
  tes = "hi"*int((len(S)/2))
  if S ==tes:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p02767 (python)

Fixed submission:
import numpy as np
N =int(input())

X = np.array([int(i) for i in input().split()])

co_min = min(X)
co_max = max(X)

Y =np.ones(co_max-co_min)

for i in range(len(Y)):
    start = co_min + i
    Y[i] = sum((X-start)**2)
if co_min != co_max:    
    ans = int(min(Y))
elif co_min == co_max:
    ans =0
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N =int(input())

X = np.array([int(i) for i in input().split()])

co_min = min(X)
co_max = max(X)

Y =np.ones(co_max-co_min)

for i in range(len(Y)):
    start = co_min + i
    Y[i] = sum((X-start)**2)
    
ans = int(min(Y))

print(ans)
Problem p02813 (python)

Fixed submission:
import numpy as np
import itertools

N = int(input())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]

Num = range(1,N+1)

Number = str(''.join(map(str,Num)))


per_num=list(itertools.permutations(Number))
pernum_arr = np.ones(len(per_num))
for i in range(len(per_num)): 
    pernum_arr[i] = int(''.join(map(str,per_num[i])))
P = int(''.join(map(str,P)))
Q = int(''.join(map(str,Q)))

ans = abs(np.where(pernum_arr==P)[0]-np.where(pernum_arr==Q)[0])
print(ans[0])

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

N = int(input())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]

Num = range(1,N+1)

Number = str(''.join(map(str,Num)))


per_num=list(itertools.permutations(Number))
pernum_arr = np.ones(len(per_num))
for i in range(len(per_num)): 
    pernum_arr[i] = int(''.join(map(str,per_num[i])))
P = int(''.join(map(str,P)))
Q = int(''.join(map(str,Q)))
print(P)
ans = abs(np.where(pernum_arr==P)[0]-np.where(pernum_arr==Q)[0])
print(ans[0])
Problem p02917 (python)

Fixed submission:
N = int(input())

B = [int(i) for i in input().split()]

ans = B[0] + B[N-2]

for i in range(1,N-1):
    ans+=min(B[i],B[i-1])
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())

B = [int(i) for i in input().split()]

ans = B[0] + B[N-1]

for i in range(1,N):
    ans+=min(B[i],B[i-1])
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())

B = [int(i) for i in input()split()]

ans = B[0] + B[N-1]

for i in range(1,N):
    ans+=min(B[i],B[i-1])
    
print(ans)
Problem p03282 (python)

Fixed submission:
s = str(input())
k = int(input())



num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != '1':
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
s = int(input())
k = int(input())


ind = 0
num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != 1:
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)
Problem p03325 (python)

Fixed submission:
import collections
import numpy as np

def prime_factorize(n):
	a = 0   
	while n % 2 == 0:
		a+=1
		n //= 2
	return a

N =int(input())

a = [int(i) for i in input().split()]

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)

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

def prime_factorize(n):
    a = []
    if n%2 ==1:
		a=0
      
    while n % 2 == 0:
		a.append(2)
        n //= 2
    return a

N =int(input())

a = [int(i) for i in input().split()]

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)
Problem p03672 (python)

Fixed submission:
import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i

    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)

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

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i
    print(j)
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)
Problem p03696 (python)

Fixed submission:
n = int(input())

s =str(input())


left_save = 0
dept=0

for i in range(len(s)):
    if s[i] ==')':
        if left_save == 0:
            dept +=1
        else:
            left_save-=1
            
    else:
        left_save+=1

ans = '('*dept + s + ')'*left_save

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

s =str(input())


left_save = 0
dept=0

for i in range(len(s)):
    if s[i] ==')':
        if left_save = 0:
            dept +=1
        else:
            left_save-=1
            
    else:
        left_save+=1

ans = '('*dept + s + ')'*left_save

print(ans)
Problem p03720 (python)

Fixed submission:
import numpy as np



N,M =[int(i) for i in input().split()]

a = np.ones(M)
b = np.ones(M)

for i in range(M):
    a[i],b[i] = [int(j) for j in input().split()]
    
ans = np.zeros(N)
    
for i in range(M):
    A = int(a[i]-1)
    B = int(b[i]-1)
    ans[A]+=1
    ans[B]+=1
    
for i in range(N):
    print(int(ans[i]))

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



N,M =[int(i) for i in input().split()]

a = np.ones(M)
b = np.ones(M)

for i in in range(M):
    a[i],b[i] = [int(j) for j in input().split()]
    
ans = np.zeros(N)
    
for i in range(N):
    A = int(a[i]-1)
    B = int(b[i]-1)
    ans[A]+=1
    ans[B]+=1
    
for i in range(N):
    print(ans[i])
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A_s[i] > B_s[i]:
            print("GREATER")
            break
        elif A_s[i] < B_s[i]:
            print("LESS")
            break
        elif (A_s[i] == B_s[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A_s[i] > B_s[i]:
            print("GREATER")
            break
        elif A_s[i] < B_s[i]:
            print("LESS")
            break
        elif (A[i] == B[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A[i] > B[i]:
            print("GREATER")
            break
        elif A[i] < B[i]:
            print("LESS")
            break
        elif (A[i] == B[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break
Problem p03796 (python)

Fixed submission:
N=int(input())
mod_lar = 10**9+7
ans =1

for i in range(1,N+1):
    ans = (i%mod_lar)*(ans%mod_lar)%mod_lar
    

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
mod_lar = 10**9+7

def fact_mod(n):
    if n==1:
        return 1
    ans = int((n%mod_lar)*(fact_mod(n-1)%mod_lar))
    return ans

print(fact_mod(N))
Problem p03863 (python)

Fixed submission:
s = str(input())

if s[-1] == s[0]:
  if len(s)%2 == 0:
    print("First")
  else:
    print("Second")
  

else:
  if len(s)%2 == 1:
    print("First")
  else:
    print("Second")

Buggy submission (verdict: Runtime Error):
s = str(input())

if s[-1] == s[0]:
  if len(S)%2 == 0:
    print("First")
  else:
    print("Second")
  

else:
  if len(S)%2 == 1:
    print("First")
  else:
    print("Second")
Problem p04032 (python)

Fixed submission:
s = str(input())

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    start_ind = -1
    end_ind = -1
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break
        
        

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    start_ind = -1
            end_ind = -1
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break
        
        

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)