Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N, Q = tuple(map(int, input().split()))

tree = [[-1, 1]  for _ in range(N)] # [next, rank]

def find(i):
    if tree[i][0] == -1:
        group = i
    else:
        group = find(tree[i][0])
    
    return group

def unite(x, y):
    px = find(x)
    py = find(y)
    
    if tree[px][1] == tree[py][1]: # rank is same
        tree[py][0] = px
        tree[px][1] += 1
    else:
        if tree[px][1] < tree[py][1]:
            px, py = py, px
        tree[py][0] = px

for _ in range(Q):
    com, x, y = tuple(map(int, input().split()))
    if com: # same
        print(int(find(x) == find(y)))
    else: # unite
        unite(x, y)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10000)
 
N, Q = tuple(map(int, input().split()))
 
tree = [[-1, 1]  for _ in range(N)] # [next, rank]
 
def find(i):
    if tree[i][0] == -1:
        group = i
    else:
        group = find(tree[i][0]) 
        tree[i][0] = group
    return group
 
def unite(x, y):
    px = find(x)
    py = find(y)
     
    if tree[px][1] == tree[py][1]: # rank is same
        tree[py][0] = px
        tree[px][1] += 1
    else:
        if tree[px][1] < tree[py][1]:
            px, py = py, px
        tree[py][0] = px
 
for _ in range(Q):
    com, x, y = tuple(map(int, input().split()))
    if com: # same
        print(int(find(x) == find(y)))
    else: # unite
        if not int(find(x) == find(y)):
            unite(x, y)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N=INT()

memo=[0]*50
memo[0]=memo[1]=1
def rec(n):
    if memo[n]:
        return memo[n]
    return rec(n-1)+rec(n-2)

print(rec(N))



Fixed submission:
# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N=INT()

memo=[0]*50
memo[0]=memo[1]=1
def rec(n):
    if memo[n]:
        return memo[n]
    memo[n]=rec(n-1)+rec(n-2)
    return memo[n]

print(rec(N))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

"""
全探索
・再帰で作る
"""

N = int(input())
aN = list(map(int, input().split()))
Q = int(input())
mQ = list(map(int, input().split()))

def dfs(cur, depth, ans):
    # 終了条件
    if cur == ans:
        return True
    # 全探索
    for i in range(depth, N):
        if dfs(cur+aN[i], i+1, ans):
            return True
    # 見つからなかった
    return False

for i in range(Q):
    if dfs(0, 0, mQ[i]):
        print('yes')
    else:
        print('no')



Fixed submission:
# -*- coding: utf-8 -*-

"""
全探索
・再帰で作る
・2^20でTLEするからメモ化した
"""

N = int(input())
aN = list(map(int, input().split()))
Q = int(input())
mQ = list(map(int, input().split()))

def dfs(cur, depth, ans):
    # 終了条件
    if cur == ans:
        return True
    # memo[現在位置]に数値curがあれば、そこから先はやっても同じだからやらない
    if cur in memo[depth]:
        return False
    memo[depth].add(cur)
    # 全探索
    for i in range(depth, N):
        if dfs(cur+aN[i], i+1, ans):
            return True
    # 見つからなかった
    return False

for i in range(Q):
    memo = [set() for j in range(N+1)]
    if dfs(0, 0, mQ[i]):
        print('yes')
    else:
        print('no')

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

"""
全探索
・ビットでやる
"""

N = int(input())
aN = list(map(int, input().split()))
Q = int(input())
mQ = list(map(int, input().split()))

for i in range(Q):
    # 全組み合わせ2^Nのループ
    for j in range(1 << N):
        sm = 0
        for k in range(N):
            # 各ビットについて、立っていればその位置の値を加算
            if j >> k & 1:
                sm += aN[k]
        if sm == mQ[i]:
            print('yes')
            break
    else:
        print('no')



Fixed submission:
# -*- coding: utf-8 -*-

"""
全探索
・再帰で作る
・2^20でTLEするからメモ化した
"""

N = int(input())
aN = list(map(int, input().split()))
Q = int(input())
mQ = list(map(int, input().split()))

def dfs(cur, depth, ans):
    # 終了条件
    if cur == ans:
        return True
    # memo[現在位置]に数値curがあれば、そこから先はやっても同じだからやらない
    if cur in memo[depth]:
        return False
    memo[depth].add(cur)
    # 全探索
    for i in range(depth, N):
        if dfs(cur+aN[i], i+1, ans):
            return True
    # 見つからなかった
    return False

for i in range(Q):
    memo = [set() for j in range(N+1)]
    if dfs(0, 0, mQ[i]):
        print('yes')
    else:
        print('no')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import sys

sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
INF=2**31-1

class BIT:
    def __init__(self, n):
        # 0-indexed
        nv = 1
        while nv < n:
            nv *= 2
        self.size = nv
        self.tree = [0] * nv

    # [0, i]を合計する
    def sum(self, i):
        s = 0
        i += 1
        while i > 0:
            s += self.tree[i-1]
            i -= i & -i
        return s

    # 値の追加：添字, 値
    def add(self, i, x):
        i += 1
        while i <= self.size:
            self.tree[i-1] += x
            i += i & -i

    # 区間和の取得 [l, r)
    def get(self, l, r=None):
        # 引数が1つなら一点の値を取得
        if r is None: r = l+1
        res = 0
        if r: res += self.sum(r-1)
        if l: res -= self.sum(l-1)
        return res

N,Q=MAP()
bit=BIT(N)
for _ in range(Q):
    com,x,y=MAP()
    if com==0:
        bit.add(x, y)
    else:
        print(bit.get(x, y+1))



Fixed submission:
# -*- coding: utf-8 -*-

import sys
from operator import add

sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
INF=float('inf')

class SegTree:
    """
    以下のクエリを処理する
    1.update:  i番目の値をxに更新する
    2.get_val: 区間[l, r)の値を得る
    """
 
    def __init__(self, n, func, init):
        """
        :param n: 要素数
        :param func: 値の操作に使う関数(min, max, addなど)
        :param init: 要素の初期値
        """
        self.n = n
        self.func = func
        self.init = init
        # nより大きい2の冪数
        n2 = 1
        while n2 < n:
            n2 <<= 1
        self.n2 = n2
        self.tree = [self.init] * (n2 << 1)
 
    def update(self, i, x):
        """
        i番目の値をxに更新
        :param i: index(0-indexed)
        :param x: update value
        """
        i += self.n2
        self.tree[i] = x
        while i > 1:
            self.tree[i >> 1] = x = self.func(x, self.tree[i ^ 1])
            i >>= 1
 
    def get_val(self, a, b):
        """
        [a, b)の値を得る
        :param a: index(0-indexed)
        :param b: index(0-indexed)
        """
        return self._get_val(a, b, 1, 0, self.n2)
 
    def _get_val(self, a, b, k, l, r):
        """
        [a, b)の値を得る内部関数
        :param k: 現在調べている区間のtree内index
        :param l, r: kが表す区間の左右端index [l, r)
        :return: kが表す区間と[a, b)の共通区間内での最小値。共通区間を持たない場合は初期値
        """
        # 範囲外なら初期値
        if r <= a or b <= l:
            return self.init
        # [a,b)が完全に[l,r)を包含するならtree[k]の値を採用
        if a <= l and r <= b:
            return self.tree[k]
        # 一部だけ範囲内なら2つに分けて再帰的に調査
        m = (l + r) // 2
        return self.func(
            self._get_val(a, b, k << 1, l, m),
            self._get_val(a, b, (k << 1) + 1, m, r)
        )

N,Q=MAP()
# 1-indexed対応
st=SegTree(N+1, add, 0)
for _ in range(Q):
    com,x,y=MAP()
    if com==0:
        st.update(x, y+st.get_val(x, x+1))
    else:
        print(st.get_val(x, y+1))
Buggy python submission (verdict: Runtime Error):
i = 0
while(True):
    print("Case %d: %s" % (i+1, input()))
    i+=1


Fixed submission:
i = 0
while(True):
    s = input()
    if(s == '0'):
        break
    print("Case %d: %s" % (i+1, s))
    i+=1

Buggy python submission (verdict: Runtime Error):
i = 0
while(True):
    s = input()
    print("Case %d: %s" % (i+1, s))
    i+=1


Fixed submission:
i = 0
while(True):
    s = input()
    if(s == '0'):
        break
    print("Case %d: %s" % (i+1, s))
    i+=1
Buggy python submission (verdict: Runtime Error):
while(True){
    f = input()
    s = f.split()
    if s[1] == '?':
        break
    print(eval(f))
}


Fixed submission:
while(True):
    f = input()
    s = f.split()
    if(s[1] == '?'):
        break
    if(s[1] == '/'):
        print((int)(s[0]) // (int)(s[2]))
    else:
        print(eval(f))

Buggy python submission (verdict: Runtime Error):
while(True):
    f = input()
    s = f.split()
    if(s[1] == '?'):
        break
    if(s[1] = '/'):
        print((int)(s[0]) // (int)(s[1]))
    else:
        print(eval(f))


Fixed submission:
while(True):
    f = input()
    s = f.split()
    if(s[1] == '?'):
        break
    if(s[1] == '/'):
        print((int)(s[0]) // (int)(s[2]))
    else:
        print(eval(f))

Buggy python submission (verdict: Runtime Error):
while(True):
    f = input()
    s = f.split()
    if(s[1] == '?'):
        break
    if(s[1] == '/'):
        print((int)(s[0]) // (int)(s[1]))
    else:
        print(eval(f))


Fixed submission:
while(True):
    f = input()
    s = f.split()
    if(s[1] == '?'):
        break
    if(s[1] == '/'):
        print((int)(s[0]) // (int)(s[2]))
    else:
        print(eval(f))
Buggy python submission (verdict: Runtime Error):
while(True):
    h, w = map(int, input().split())
    if(h == 0 and w == 0):
        break
    for i in range(h):
        s = ''
        for j in range(w):
            s += '#' if ((i + j) % 2 == 0) else s += '.'
        print(s)
    print()



Fixed submission:
while(True):
    h, w = map(int, input().split())
    if(h == 0 and w == 0):
        break
    for i in range(h):
        s = ''
        for j in range(w):
            if (i + j) % 2 == 0:
                s += '#'
            else:
                s += '.'
        print(s)
    print()
Buggy python submission (verdict: Runtime Error):
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
ans = []
for i in range(x):
    if(nabeatsu(i + 1)):
        ans.append(i + 1)
print(' '.join(ans))


Fixed submission:
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
for i in range(x):
    if(nabeatsu(i + 1)):
        print(' ', end = '')
        print(i + 1, end = '')
print()

Buggy python submission (verdict: Runtime Error):
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
ans = []
for i in range(x):
    if(nabeatsu(i + 1)):
        ans.append(i + 1)
print((' '.join(ans)))


Fixed submission:
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
for i in range(x):
    if(nabeatsu(i + 1)):
        print(' ', end = '')
        print(i + 1, end = '')
print()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from math import sqrt
import numpy as np


# n = int(input())
# tmp = input().split(' ')
tmp = '0.0 0.0 2.0 0.0 2.0 2.0'.split(' ')
# tmp = '0.0 3.0 -1.0 0.0 -3.0 4.0'.split(' ')
a, b, c = [(float(tmp[i]), float(tmp[i+1])) for i in range(0, len(tmp), 2)]

A = np.array(((a[0], a[1], 1),
              (b[0], b[1], 1),
              (c[0], c[1], 1)))

B = np.array((((-(a[0]**2 + a[1]**2))),
              ((-(b[0]**2 + b[1]**2))),
              ((-(c[0]**2 + c[1]**2)))))

tmp = np.dot(np.linalg.inv(A), B)

#tmp = [-6, 10, 18]

x = -tmp[0]/2
y = -tmp[1]/2
r = sqrt((tmp[0]**2 + tmp[1]**2 - 4*tmp[2])/4)

print('{:.3} {:.3} {:.3}'.format(x, y, r))


Fixed submission:
# -*- coding: utf-8 -*-
from math import sqrt
# import numpy as np


n = int(input())

for i in range(n):
    tmp = input().split(' ')
    
    a, b, c = [(float(tmp[i]), float(tmp[i+1])) for i in range(0, len(tmp), 2)]
    
    #A = np.array(((a[0], a[1], 1),
    #              (b[0], b[1], 1),
    #              (c[0], c[1], 1)))
    A_tmp1 = 1/(a[0]*b[1] + a[1]*c[0] + b[0]*c[1] - b[1]*c[0] - a[1]*b[0] - a[0]*c[1])
    A_tmp2 = [[b[1]-c[1], -(a[1]-c[1]), a[1]-b[1]],
              [-(b[0]-c[0]),  (a[0]-c[0]), -(a[0]-b[0])],
              [b[0]*c[1] - b[1]*c[0], -(a[0]*c[1] - a[1]*c[0]), a[0]*b[1] - a[1]*b[0]]]
    A = [list(map(lambda x: A_tmp1*x, A_tmp2[i])) for i in range(3)]
    
    #B = np.array((((-(a[0]**2 + a[1]**2))),
    #              ((-(b[0]**2 + b[1]**2))),
    #              ((-(c[0]**2 + c[1]**2)))))
    B = [[-(a[0]**2 + a[1]**2)],
         [-(b[0]**2 + b[1]**2)],
         [-(c[0]**2 + c[1]**2)]]
    
    
    tmp = [sum([A[i][j]*B[j][0] for j in range(3)]) for i in range(3)]
    # tmp = np.dot(np.linalg.inv(A), B)
    
    x = -tmp[0]/2
    y = -tmp[1]/2
    r = sqrt((tmp[0]**2 + tmp[1]**2 - 4*tmp[2])/4)
    
    print('{:.3f} {:.3f} {:.3f}'.format(x, y, r))
Buggy python submission (verdict: Runtime Error):
from collections import deque
import sys


def suffle(deck, c):
    l = len(deck)
    if l % 2 == 0: mid = l//2
    else: mid = (l-1)//2
    deckA = deck[mid:]
    deckB = deck[:mid]
    deckC = []
    
    while(len(deckA) != 0 or len(deckB) != 0):
        deckC.extend(deckA[:c])
        deckA = deckA[c:]
        deckC.extend(deckB[:c])
        deckB = deckB[c:]

    return deckC

while(True):
    deck = []
    n, r = map(int, sys.stdin.readline()[:-1].split())
    deck = [i for i in range(n)]
    c_list = map(int, sys.stdin.readline()[:-1].split())
    for c in c_list:
        deck = suffle(deck, c)

    print(deck[-1])
    #print(" ".join(map(str, deck)))

Fixed submission:
from collections import deque
import sys


def suffle(deck, c):
    l = len(deck)
    if l % 2 == 0: mid = l//2
    else: mid = (l-1)//2
    deckA = deck[mid:]
    deckB = deck[:mid]
    deckC = []
    
    while(len(deckA) != 0 or len(deckB) != 0):
        deckC.extend(deckA[:c])
        deckA = deckA[c:]
        deckC.extend(deckB[:c])
        deckB = deckB[c:]

    return deckC

while(True):
    inp = sys.stdin.readline()
    if not inp: break
    deck = []
    n, r = map(int, inp[:-1].split())
    deck = [i for i in range(n)]
    c_list = map(int, sys.stdin.readline()[:-1].split())
    for c in c_list:
        deck = suffle(deck, c)

    print(deck[-1])
    #print(" ".join(map(str, deck)))
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
n = int(n)

pl = []
for i in range(n):
    pl.append(int(input()))

l = []
for i, p in enumerate(pl[:-1]):
    l.append(max(pl[i+1:])-p)

m = max(l)
print(m)

Fixed submission:
n = input()
n = int(n)

pl = []
for i in range(n):
    pl.append(int(input()))

m = pl[0]
M = pl[0]
difM = pl[1]-pl[0]

for i, p in enumerate(pl[1:]):
    if p < m: 
        m = p
        continue
    if p - m > difM:
        difM = p - m

print(difM)
Buggy python submission (verdict: Runtime Error):
from collections import deque

queue = deque([])

n = int(input())

for i in range(n):
    commands = input().split(" ")
    command = commands[0]
    if command == "insert":
        queue.appendleft(commands[1])
    elif command == "delete":
        queue.remove(commands[1])
    elif command == "deleteFirst":
        queue.popleft()
    elif command == "deleteLast":
        queue.pop()

last = queue.pop()
for i in queue:
    print(i, end=" ")

print(last)

Fixed submission:
import sys
from collections import deque

queue = deque()

for _ in range(int(sys.stdin.readline())):
    commands = sys.stdin.readline()[:-1].split(" ")
    if commands[0] == "insert":
        queue.appendleft(commands[1])
    elif commands[0] == "delete":
        try:
            queue.remove(commands[1])
        except ValueError:
            pass
    elif commands[0] == "deleteFirst":
        queue.popleft()
    elif commands[0] == "deleteLast":
        queue.pop()

print(" ".join(queue))

Buggy python submission (verdict: Runtime Error):
from collections import deque

queue = deque()

for _ in range(int(input())):
    commands = input().split(" ")
    if command[0] == "insert":
        queue.appendleft(commands[1])
    elif command[0] == "delete":
        try:
            queue.remove(commands[1])
        except ValueError:
            pass
    elif command[0] == "deleteFirst":
        queue.popleft()
    elif command[0] == "deleteLast":
        queue.pop()

print(" ".join(queue))

Fixed submission:
import sys
from collections import deque

queue = deque()

for _ in range(int(sys.stdin.readline())):
    commands = sys.stdin.readline()[:-1].split(" ")
    if commands[0] == "insert":
        queue.appendleft(commands[1])
    elif commands[0] == "delete":
        try:
            queue.remove(commands[1])
        except ValueError:
            pass
    elif commands[0] == "deleteFirst":
        queue.popleft()
    elif commands[0] == "deleteLast":
        queue.pop()

print(" ".join(queue))
Buggy python submission (verdict: Runtime Error):
n = int(input())

S = map(int, input().split(" "))

q = int(input())

T = map(int, input().split(" "))

def binary_search(target, key):
    left = 0
    right = len(S)

    while(left < right):
        mid = (left + right) // 2
        if S[mid] == key:
            return True
        elif S[mid] < key:
            left = mid
        else:
            right = mid

    return False

cnt = 0
for t in T:
    if binary_search(S, t): cnt += 1

print(cnt)

Fixed submission:
n = int(input())

S = list(map(int, input().split(" ")))

q = int(input())

T = list(map(int, input().split(" ")))

def binary_search(target, key):
    left = 0
    right = len(S)

    while(left < right):
        mid = (left + right) // 2
        if S[mid] == key:
            return True
        elif S[mid] < key:
            left = mid + 1
        else:
            right = mid

    return False

cnt = 0
for t in T:
    if binary_search(S, t): cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
a=int(input())
li=[0]*1000001
count=1
i=2 # ??????????????°
while i<a:    
    r=0
    ta=a
    b=i
    if li[i]!=1:
        while True:
                    
            r=ta%b
            if r==0:
                break
            ta=b
            b=r
        if b==1:
            count+=1
        else:
            temp=i
            l=2
            while True:
               li[temp*l]=1
               l+=1
               if temp*l>a:
                   break
    i+=1                
print(count)

Fixed submission:
def soi(n): #?´??????°????§£?????¢?????´?????????
    i=2
    while True:
        if i*i>n:
            return n
        
        if n%i==0:
            return i
        i+=1


a=int(input())
ans=a
count=1
i=2 # ??????????????°
while True:
    temp=soi(a)
    if a==1: #?´??????°??????????????°
        break
    while a%temp==0: #?´??????°??§???????¶???????
        a/=temp
     #   print (a)

    ans*=(1-1/temp)
    #print (ans)

print(int(ans))


                
       

def gcd(a,b): #?????§??¬?´???°???????????°??????
    r=0
    while True:
       r=a%b
       if r==0:
           break
       a=b
       b=r
    return b

Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
li=[0]*10000000
count=1
i=2 # ??????????????°
while i<a:    
    r=0
    ta=a
    b=i
    if li[i]!=1:
        while True:
                    
            r=ta%b
            if r==0:
                break
            ta=b
            b=r
        if b==1:
            count+=1
        else:
            temp=i
            l=2
            while True:
               li[temp*l]=1
               l+=1
               if temp*l>a:
                   break
    i+=1                
print(count)

Fixed submission:
def soi(n): #?´??????°????§£?????¢?????´?????????
    i=2
    while True:
        if i*i>n:
            return n
        
        if n%i==0:
            return i
        i+=1


a=int(input())
ans=a
count=1
i=2 # ??????????????°
while True:
    temp=soi(a)
    if a==1: #?´??????°??????????????°
        break
    while a%temp==0: #?´??????°??§???????¶???????
        a/=temp
     #   print (a)

    ans*=(1-1/temp)
    #print (ans)

print(int(ans))


                
       

def gcd(a,b): #?????§??¬?´???°???????????°??????
    r=0
    while True:
       r=a%b
       if r==0:
           break
       a=b
       b=r
    return b
Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
S=r*r*math.pi
L=2*r*math.pi
print('%.6f %.6f'%(S,L))

Fixed submission:
import math
r=float(input())
S=r*r*math.pi
L=2*r*math.pi
print('%.5f %.5f'%(S,L))

Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
S=r*r*math.pi
L=2*r*math.pi
print('%.5f %.5f'%(S,L))

Fixed submission:
import math
r=float(input())
S=r*r*math.pi
L=2*r*math.pi
print('%.5f %.5f'%(S,L))
Buggy python submission (verdict: Runtime Error):
sent=""
while True:
    ex=input().lower()
    if len(ex)==0:
        break
    sent+=ex
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Fixed submission:
sent=""
while True:
    try:
        ex=input().lower()
        sent+=ex
    except:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Buggy python submission (verdict: Runtime Error):
sent=""
while True:
    ex=input().lower()
    print(ex)
    sent+=ex
    if ex.find('.')==1:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Fixed submission:
sent=""
while True:
    try:
        ex=input().lower()
        sent+=ex
    except:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Buggy python submission (verdict: Runtime Error):
sent=""
while True:
    ex=input().lower()
    sent+=ex
    if ex.find('.')==1:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Fixed submission:
sent=""
while True:
    try:
        ex=input().lower()
        sent+=ex
    except:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Buggy python submission (verdict: Runtime Error):
sent=""
while True:
    ex=input().lower()
    sent+=ex
    if ex.endswith(".")==True:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

Fixed submission:
sent=""
while True:
    try:
        ex=input().lower()
        sent+=ex
    except:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)
Buggy python submission (verdict: Runtime Error):
i = 0
n = int(input())
maxR = -10**9
minR = int(input())
while i < n:
    R = int(input())
    maxR = max(maxR, R-minR)
    minR = min(minR, R)
    i += 1
print(maxR)

Fixed submission:
a = -1e9
b = 2e9
for n in range(int(input())):
    r = int(input())
    a = max(a, r - b)
    b = min(b, r)
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
l=[]
for i in range(x):
    l.append(int(input()))
max_ = -99999999999999999999999
for i, v1 in enumerate(l):
    for j, v2 in enumerate(l):
        if j > i:
            if v2-v1 > max_:
                max_ = v2-v1
print(max_)

Fixed submission:
x = int(input())
l=[]
for i in range(x):
    l.append(int(input()))
MIN = 999999999999999999999999999999999999999
MAX = -9999999999999999999999999999999999999
for i in l:
    if i - MIN > MAX:
        MAX = i - MIN
    if i < MIN:
        MIN = i
print(MAX)