Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n , m  = list(map(int,input().split()))
counter = 0
if n < m // 2:
    counter = n
    m = m - 2* n
else:
    counter = m //2
    n = n - m //2

counter = counter + m //4 
    
    
print(count)

Fixed submission:
n , m  = list(map(int,input().split()))
counter = 0
if n <= m // 2:
    counter = n
    m = m - 2* n
    n = 0
else:
    counter = m //2
    n = n - m //2
    m = 0

counter = counter + m //4 

kouho = m //4
print(max(counter,kouho))

Buggy python submission (verdict: Time Limit Exceeded):
n , m  = list(map(int,input().split()))
count = 0
while n >= 1 and m >= 2:
    count = count + 1
    n = n -1
    m = m -2

while m >= 4:
    count = count + 1
    m = m-4
    
    
print(count)

Fixed submission:
n , m  = list(map(int,input().split()))
counter = 0
if n <= m // 2:
    counter = n
    m = m - 2* n
    n = 0
else:
    counter = m //2
    n = n - m //2
    m = 0

counter = counter + m //4 

kouho = m //4
print(max(counter,kouho))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int,input().split()))

flag = 1
if n % 2 == 1 :
    for i in range(0,n,2):
        if i == 0 :
            if x.count(i) !=1:
                flag = 0
                break
        elif x.count(i) == 2:
            x.remove(i)
            x.remove(i)
            continue
        else:
            flag = 0
            break
else:
    for i in range(1,n,2):  
        if x.count(i) == 2:
            x.remove(i)
            x.remove(i)
            continue
        else:
            flag = 0
            break
            
if flag == 1:
    ans = 1
    if n >=2:
        for i in range(n // 2 ):
            ans = (ans * 2) % (10 ** 9 + 7)
        
    print(2 ** ((n) // 2 ))
else:
    print(0)
    

Fixed submission:
n = int(input())
x = list(sorted(list(map(int,input().split()))))

flag = 1
if n % 2 == 1 :
    for i in range(0,n):
        if i == 0 :
            co = 0
            if x[i] == 0:
                x[i] = -1

        elif i != 0 and i <= n-2 and (i) % 2 ==1 :
            if x[i] == i+1 and x[i+1] == i+ 1 and (i+1) % 2 == 0:
                x[i] = -1
                x[i+1] = -1
        else:
            continue
else:
    for i in range(0,n):  
        if x[i] == i+1 and x[i+1] == i+ 1 and (i+1) % 2 == 1 and i <= n-2:
            x[i] = -1
            x[i+1] = -1
        else:
            continue
            
if list(set(x)) == [-1]:
    ans = 1
    if n >=2:
        for i in range(n // 2 ):
            ans = (ans * 2) % (10 ** 9 + 7)
        
    print(ans)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int,input().split()))

flag = 1
if n % 2 == 1 :
    for i in range(0,n,2):
        if i == 0 :
            if x.count(i) !=1:
                flag = 0
                break
        elif x.count(i) != 2:
            flag = 0
            break
else:
    for i in range(1,n,2):
        if x.count(i) != 2:
            flag = 0
            break
            
if flag == 1:
    ans = 1
    if n >=2:
        for i in range(n // 2 ):
            ans = (ans * 2) % (10 ** 9 + 7)
        
    print(2 ** ((n) // 2 ))
else:
    print(0)
    

Fixed submission:
n = int(input())
x = list(sorted(list(map(int,input().split()))))

flag = 1
if n % 2 == 1 :
    for i in range(0,n):
        if i == 0 :
            co = 0
            if x[i] == 0:
                x[i] = -1

        elif i != 0 and i <= n-2 and (i) % 2 ==1 :
            if x[i] == i+1 and x[i+1] == i+ 1 and (i+1) % 2 == 0:
                x[i] = -1
                x[i+1] = -1
        else:
            continue
else:
    for i in range(0,n):  
        if x[i] == i+1 and x[i+1] == i+ 1 and (i+1) % 2 == 1 and i <= n-2:
            x[i] = -1
            x[i+1] = -1
        else:
            continue
            
if list(set(x)) == [-1]:
    ans = 1
    if n >=2:
        for i in range(n // 2 ):
            ans = (ans * 2) % (10 ** 9 + 7)
        
    print(ans)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
fig = []
h,w  = map(int,input().split())
for i in range(h):
    fig.append(list(str(input())))
    
fig_2 = []

for i in range(h):
    fig_2.append(fig[i])
    fig_2.append(fig[i])
    
for i in range(len(fig_2)):
    onetime = ''
    for j in range(fig_2[i]):
        onetime = onetime + fig_2[i][j]
    print(onetime)
    

Fixed submission:
fig = []
h,w  = map(int,input().split())
for i in range(h):
    fig.append(list(str(input())))
    
fig_2 = []

for i in range(h):
    fig_2.append(fig[i])
    fig_2.append(fig[i])
    
for i in range(len(fig_2)):
    onetime = ''
    for j in range(len(fig_2[i])):
        onetime = onetime + fig_2[i][j]
    print(onetime)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(str(input()))

for i in range(len(s)- 5):
    if s[i] == 'e' and s[i+1] == 'r' and s[i + 2] == 'a' and s[i + 3] == 's' and s[i + 4] == 'e' and s[i+5] == 'r':
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''
        s[i + 5] = ''
        
while '' in s:
    s.remove('')
    
for i in range(len(s)- 4):
    if s[i] == 'e' and s[i+1] == 'r' and s[i + 2] == 'a' and s[i + 3] == 's' and s[i + 4] == 'e' :
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''
        
while '' in s:
    s.remove('')
    
    
    
for i in range(len(s)- 6):
    if s[i] == 'd' and s[i+1] == 'r' and s[i + 2] == 'e' and s[i + 3] == 'a' and s[i + 4] == 'm' and s[i + 5] == 'e' and s[i + 6] == 'r':
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''
        s[i + 5] = ''
        s[i+6] = ''
        
while '' in s:
    s.remove('')
    
for i in range(len(s)- 4):
    if s[i] == 'd' and s[i+1] == 'r' and s[i + 2] == 'e' and s[i + 3] == 'a' and s[i + 4] == 'm' :
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''

        
while '' in s:
    s.remove('')
    
if s == []:
    print('YES')
else:
    print('NO')

Fixed submission:
s = list(str(input()))



for i in range(len(s)- 5):
    if s[i] == 'e' and s[i+1] == 'r' and s[i + 2] == 'a' and s[i + 3] == 's' and s[i + 4] == 'e' and s[i+5] == 'r':
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''
        s[i + 5] = ''
        
        
for i in range(len(s)- 4):
    if s[i] == 'e' and s[i+1] == 'r' and s[i + 2] == 'a' and s[i + 3] == 's' and s[i + 4] == 'e' :
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''
        

    
    
    
for i in range(len(s)- 6):
    if s[i] == 'd' and s[i+1] == 'r' and s[i + 2] == 'e' and s[i + 3] == 'a' and s[i + 4] == 'm' and s[i + 5] == 'e' and s[i + 6] == 'r':
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''
        s[i + 5] = ''
        s[i+6] = ''
        

    
for i in range(len(s)- 4):
    if s[i] == 'd' and s[i+1] == 'r' and s[i + 2] == 'e' and s[i + 3] == 'a' and s[i + 4] == 'm' :
        s[i] = ''
        s[i+1] = ''
        s[i + 2] = ''
        s[i + 3] = ''
        s[i + 4] = ''

        
while '' in s:
    s.remove('')
    
if s == []:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
s = list(map(str,input().split()))
 
t = (list(s[1])).capitalize()
 
print('A' + t + 'C')

Fixed submission:
s = list(str(input()))
t = s[8].upper()
 
print('A' + t + 'C')

Buggy python submission (verdict: Runtime Error):
s = list(map(str,input().split()))

t = (list(s[1])).capitalize()

print(A + t + C)

Fixed submission:
s = list(str(input()))
t = s[8].upper()
 
print('A' + t + 'C')
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
a = list((map(int,input().split())))

b = [0]
for i in range(n):
    b.append(a[i])
b.append(0)    
count = 0

if b[1] > x:
    counter = b[1] - x
    b[1] = x
for i in range(n+1):
    if b[i] + b[i+1] > x:
        s = b[i] + b[i+1] - x
        if b[i] - s > -1:
            b[i] = b[i] -s
            counter = counter + s
        else:
            k = b[i]
            counter = counter + s
            b[i] = 0
            b[i+1] = x
        
print(counter)

Fixed submission:
n,x = map(int,input().split())
a = list((map(int,input().split())))

b = [0]
for i in range(n):
    b.append(a[i])
b.append(0)    
counter = 0

if b[1] > x:
    counter = b[1] - x
    b[1] = x
for i in range(n+1):
    if b[i] + b[i+1] > x:
        s = b[i] + b[i+1] - x
        if b[i+1] - s > -1:
            b[i+1] = b[i+1] -s
            counter = counter + s
        else:
            k = b[i+1]
            counter = counter + s
            b[i+1] = 0
            b[i] = x
        
print(counter)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
a = list(map(int,input().split()))

s = a[0] + a[1]
s.append(0)
p = 0
if a[0] > x:
    a[0] = x
    p = a[0] - x
    
for i in range(0,n):
    pp = a[i] + a[i + 1]
    if pp > x:
        a[i+1] = a[i+1] - pp + x
        p = p + pp -x
        
print(p)
    

Fixed submission:
n,x = map(int,input().split())
a = list((map(int,input().split())))

b = [0]
for i in range(n):
    b.append(a[i])
b.append(0)    
counter = 0

if b[1] > x:
    counter = b[1] - x
    b[1] = x
for i in range(n+1):
    if b[i] + b[i+1] > x:
        s = b[i] + b[i+1] - x
        if b[i+1] - s > -1:
            b[i+1] = b[i+1] -s
            counter = counter + s
        else:
            k = b[i+1]
            counter = counter + s
            b[i+1] = 0
            b[i] = x
        
print(counter)
Buggy python submission (verdict: Runtime Error):
n = int(input())
import math as m
tt , aa = map(int,input().split())
vote = tt + aa
for i in range(n-1):
    t, a = map(int,input().split())
    n = m.flo-or((max((tt/t),(aa/a))))
    tt = t * n
    aa = a * n
    vote = tt + aa
print(vote)

Fixed submission:
n = int(input())
import math as m
t1 , a1 = map(int,input().split())
tt = t1
aa = a1
for i in range(n-1):
    t, a = map(int,input().split())
    n = ((max((tt//t),(aa//a))))
    if tt > t*n or aa> a*n:
        n = n + 1
    tt = t * n
    aa = a * n
print(tt + aa)

Buggy python submission (verdict: Runtime Error):
n = int(input())
import math as m
tt , aa = map(int,input().split())
vote = tt + aa
for i in range(n-1):
    t, a = map(int,input().split())
    n = max(m.cail(tt/t),m.ceil(aa/a))
    vote = vote * n
print(vote)

Fixed submission:
n = int(input())
import math as m
t1 , a1 = map(int,input().split())
tt = t1
aa = a1
for i in range(n-1):
    t, a = map(int,input().split())
    n = ((max((tt//t),(aa//a))))
    if tt > t*n or aa> a*n:
        n = n + 1
    tt = t * n
    aa = a * n
print(tt + aa)

Buggy python submission (verdict: Runtime Error):
n = int(input())
vote = 0
tt = 0
aa = 0
for i in range(n):
    t, a = map(int,input().split())
    if (tt < t and aa = a) or (tt = t and aa < a) or (tt< t and aa <a):
        tt = t
        aa = a
        vote = t + a
    else:
        count = 1
        s = t + a
        while vote > s:
            count = count + 1
            s = s * count
            
        vote = s
        tt = count * t
        ss = count * a
            
print(vote)

Fixed submission:
n = int(input())
import math as m
t1 , a1 = map(int,input().split())
tt = t1
aa = a1
for i in range(n-1):
    t, a = map(int,input().split())
    n = ((max((tt//t),(aa//a))))
    if tt > t*n or aa> a*n:
        n = n + 1
    tt = t * n
    aa = a * n
print(tt + aa)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = n
a = int(input())
b = int(input())
c = int(input())
count = 0
ng = [a,b,c]
flag = 0
while count < 100 and n != (a or b or c) and n >=4:
    if not (n-3 in ng):
        count += 1
        n = n-3
    elif not (n-2 in ng):
        count += 1
        n = n-2
    elif not (n-1 in ng):
        count += 1
        n = n-1
    else:
        flag = 0
        break
if (n == 1 or n == 2 or n ==3) and count<=99 and (n not in ng):
    n = 0
    
if n > 0:
    flag = 0
    
if (flag == 1 or n == 0) and not (s in ng):
    print('YES')
else:
    print('NO')

Fixed submission:
s = int(input())
sl = list(str(s))
sl_n = len(sl) - 1
l = ['a','b']
def a_or_b(x):
    if len(list(str(x[0]))) == sl_n:
        return x
    else:
        ll = []
        for i in range(len(x)):
            ll.append(x[i] + 'a')
        for i in range(len(x)):
            ll.append(x[i] + 'b')
        x = ll
        return a_or_b(x)
    
lll = []
ans = 0

if len(sl) == 1:
    ans = s
else:
    lll = a_or_b(l)
    kkk = []
    for i in range(len(lll)):
        p = sl
        q = list(str(lll[i]))
        st = ''
        for j in range(len(p) - 1):
            if q[j] == 'a':
                st = st + p[j] +'+'
            else:
                st = st + p[j] + ''
        st = st + sl[-1]
        res = eval(st)
        ans += res
        
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n):
        listB = []
        for k in range(1,listA[i][0]+1):
        	listB.append(listA[i][k])
        	if listA[0][j] not in listB:
            	break
    else:
    	x += 1
print(x)

Fixed submission:
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n):
        listB = []
        for k in range(1,listA[i][0]+1):
          listB.append(listA[i][k])
        if listA[0][j] not in listB:
          break
    else:
    	x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n+1):
        if listA[0][j] not in listA[i] and listA[0][j] == listA[i][0]:
            break
    else:
    	x += 1
print(x)

Fixed submission:
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n):
        listB = []
        for k in range(1,listA[i][0]+1):
          listB.append(listA[i][k])
        if listA[0][j] not in listB:
          break
    else:
    	x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n+1):
        if listA[0][j] not in listA[i] and listA[0][j] == listA[i][0]:
            break
        x += 1
print(x)

Fixed submission:
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n):
        listB = []
        for k in range(1,listA[i][0]+1):
          listB.append(listA[i][k])
        if listA[0][j] not in listB:
          break
    else:
    	x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n+1):
        if listA[0][j] not in listA[i]:
            break
        x += 1
print(x)

Fixed submission:
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n):
        listB = []
        for k in range(1,listA[i][0]+1):
          listB.append(listA[i][k])
        if listA[0][j] not in listB:
          break
    else:
    	x += 1
print(x)
Buggy python submission (verdict: Runtime Error):
T = int(T)
X = int(X)
t = T / X

Fixed submission:
t,x = map(int,input().split())
print(t/x)

Buggy python submission (verdict: Runtime Error):
T = input("T")
T = int(T)
X = input("X")
X = int(X)
t = T / X

Fixed submission:
t,x = map(int,input().split())
print(t/x)
Buggy python submission (verdict: Runtime Error):
d,n = map(int,input().split())
s = n * (100**d)
s1 = 101 * (100**d)
if n <= 99:
  print(s)
elif n = 100:
  print(s1)

Fixed submission:
d,n = map(int,input().split())
s = n * (100**d)
s1 = 101 * (100**d)
if n <= 99:
  print(s)
else:
  print(s1)

Buggy python submission (verdict: Runtime Error):
d,n = map(int,input().split())
if n <= 99:
  print(n * (100 ** d))
elif n = 100:
  print(101 * (100 ** d))

Fixed submission:
d,n = map(int,input().split())
s = n * (100**d)
s1 = 101 * (100**d)
if n <= 99:
  print(s)
else:
  print(s1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n <= 999:
    print(ABC)
else:
    print(ABD)

Fixed submission:
n = int(input())
if n <= 999:
    print("ABC")
else:
    print("ABD")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

ans = [0 for i in range(M)]

for i in range(N):
    tmp = list(map(int, input().split()))
    for j in range(tmp[0]):
        ans[tmp[j]]+=1
        
now = 0
        
for i in range(M):
    if ans[i]==N:
        now+=1
        
print(now)

Fixed submission:
N, M = map(int, input().split())

ans = [0 for i in range(M)]

for i in range(N):
    tmp = list(map(int, input().split()))
    for j in range(tmp[0]):
        ans[tmp[j+1]-1]+=1
        
now = 0
        
for i in range(M):
    if ans[i]==N:
        now+=1
        
print(now)
Buggy python submission (verdict: Runtime Error):
#N, M = map(int, input().split())
#
#ans = [0 for i in range(M)]
#
#for i in range(N):
#    tmp = list(map(int, input().split()))
#    for j in range(tmp[0]):
#        ans[tmp[j]]+=1
#        
#now = 0
#        
#for i in range(M):
#    if ans[i]==N:
#        now+=1
#        
#print(now)
import math

N = int(input())
a = list(map(int, input().split()))

        
ans = 0
now = a[0]

for i in range(N-1):
    now = math.gcd(now, a[i+1])

    
print(now)

Fixed submission:
#N, M = map(int, input().split())
#
#ans = [0 for i in range(M)]
#
#for i in range(N):
#    tmp = list(map(int, input().split()))
#    for j in range(tmp[0]):
#        ans[tmp[j]]+=1
#        
#now = 0
#        
#for i in range(M):
#    if ans[i]==N:
#        now+=1
#        
#print(now)

N = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if a<b:
        b,a = a,b
        
    while b:
        a, b = b, a%b
    
    return a


ans = 0
now = a[0]

for i in range(N-1):
    tmp = gcd(now, a[i+1])
    now = tmp

    
print(now)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().splitr())

print(a*b//2)

Fixed submission:
a, b, c = map(int, input().split())

print(a*b//2)
Buggy python submission (verdict: Runtime Error):
S = input()

tag = 'keyence'

ans = 0

for i in range(1, 7):
    f_tag = tag[0:i]
    a_tag = tag[i:7]
    f1 = 1
    now = 0
    
    for j in range(len(S)-7):
        for k in range(i):
            if not S[j+k]==f_tag[k]:
                break
        else:
            f1 = f1 + 1
            now = j+i
    
    for j in range(now, len(S)-i):
        for k in range(7-i):
            if not S[j+k]==a_tag[k]:
                break
        else:
            f1 = f1+1
    if f1==3 or (f1==2 and i==0) or (f1==2 and i==7):
        ans =1
    
for i in range(len(S)-6):
    for j in range(7):
        if not S[i+j]==tag[j]:
            break
    else:
        ans = 1
    
if ans==1:
    print('YES')
else:
    print('NO')

Fixed submission:
S = input()

tag = 'keyence'

ans = 0

if S[0:7]==tag:
    ans = 1
elif S[len(S)-7:len(S)]==tag:
    ans = 1
else:
    for j in range(1, 6):
        f_tag = tag[0:j]
        a_tag = tag[j+1:7]
        f = 1
        for k in range(len(f_tag)):
            if not S[k]==f_tag[k]:
                f = -1
        for k in range(len(a_tag)):
            if not S[len(S)-len(a_tag)+k]==a_tag[k]:
                f = -1
        if f>0:
            ans = 1

if ans>0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())

if M%N == 0:
    ans = M//N
else:
    for i in range(M//N, 0, -1):
        ama = M - i*N
        if ama%i==0:
            ans = i
            break

print(ans)

Fixed submission:
N,M = map(int, input().split())

if M%N == 0:
    ans = M//N
else:
    for i in range(M//N, 0, -1):
        ama = M - i*N
        if ama%i==0:
            ans = i
            break

print(ans)
Buggy python submission (verdict: Runtime Error):

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


n,x = map(int, input().split())

w = list(map(int, input().split()))

a = []

for i in range(n):
    tmp = abs(w[i]-x)
    a.append(tmp)
    
#ans = a[0]
#
#for i in range(1, n):
#    now = a[i]
    
print(gcd_list(a))

Fixed submission:

#import functools
#import math

def gcd(a, b):
    if a<b:
        b,a = a,b        
    while b:
        a, b = b, a % b
    return a

n,x = map(int, input().split())

w = list(map(int, input().split()))

a = []

for i in range(n):
    tmp = abs(w[i]-x)
    a.append(tmp)
    
ans = a[0]

for i in range(1, n):
    now = a[i]
    ans = gcd(ans, now)
    
print(ans)

#print(functools.reduce(math.gcd, a))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 18 00:01:41 2018

@author: Yuya
"""

n, m=map(int, input().split())

ans = []
c = 0

for i in range(n):
    tmp=list(input())
    f = 1
    for j in range(m):
        if tmp[j]=="#":
            f = -1
    if f<0:
        ans.append(tmp)
        c+=1


ans2 = [["0" for i in range(c)] for j in range(m)]

for i in range(m):
    for j in range(c):
        ans2[i][j] = ans[j][i]


d = m

for i in range(m-1, -1, -1):
    f = 1
    for j in range(c):
        if ans2[i][j]=="#":
            f = -1
    if f>0:
        del ans2[i]
        d-=1
        


ans3 = [["0" for i in range(c)] for j in range(d)]

for i in range(d):
    for j in range(c):
        ans3[i][j] = ans2[j][i]



for i in range(c):
    print(''.join(ans3[i]))

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 18 00:01:41 2018

@author: Yuya
"""

n, m=map(int, input().split())

ans = []
c = 0

for i in range(n):
    tmp=list(input())
    f = 1
    for j in range(m):
        if tmp[j]=="#":
            f = -1
    if f<0:
        ans.append(tmp)
        c+=1


ans2 = [["0" for i in range(c)] for j in range(m)]

for i in range(m):
    for j in range(c):
        ans2[i][j] = ans[j][i]


d = m

for i in range(m-1, -1, -1):
    f = 1
    for j in range(c):
        if ans2[i][j]=="#":
            f = -1
    if f>0:
        del ans2[i]
        d-=1
        


ans3 = [["0" for i in range(d)] for j in range(c)]

for i in range(d):
    for j in range(c):
        ans3[j][i] = ans2[i][j]



for i in range(c):
    print(''.join(ans3[i]))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())

ans=[a,b,c]
ans.sort()

print(abs(ans(0)-ans(1))+abs(ans(1)-ans(2)))

Fixed submission:

a,b,c=map(int,input().split())

ans=[a,b,c]
ans.sort()

print(abs(ans[0]-ans[1])+abs(ans[1]-ans[2]))