Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
    card = raw_input()
    if card == "-"
        break
    m = int(raw_input())
    for shuffle in range(m):
        h =int(raw_input())
        card = card[h:] + card[:h]
    print card

Fixed submission:
while True:
    card = raw_input()
    if card == "-":
        break
    m = int(raw_input())
    for shuffle in range(m):
        h =int(raw_input())
        card = card[h:] + card[:h]
    print card
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
score = [0,0]

for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score += 1
print score[0], score[1]

Fixed submission:
score = [0, 0]

n = int(raw_input())
for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score[0] += 1
        score[1] += 1
print score[0], score[1]

Buggy python submission (verdict: Runtime Error):
score = [0, 0]

n = int(raw_input())
for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score[] += 1
print score[0], score[1]

Fixed submission:
score = [0, 0]

n = int(raw_input())
for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score[0] += 1
        score[1] += 1
print score[0], score[1]
Buggy python submission (verdict: Runtime Error):
s = list(raw_input())
for loop in xrange(input()):
    c = raw_input().split()
    if c[0] == "replace":
        s[int(c[1]): int(c[2]) + 1] = list(c[3])
    if c[0] == "reverse":
        s[int(c[1]): int(c[2]) + 1] = s[int(c[1]): int(c[2) + 1][::-1]
    if c[0] == "print":
        print "".join(s[int(c[1]): int(c[2]) + 1]

Fixed submission:
s = list(raw_input())
for loop in xrange(input()):
    c = raw_input().split()
    if c[0] == "replace":
        s[int(c[1]): int(c[2]) + 1] = list(c[3])
    if c[0] == "reverse":
        s[int(c[1]): int(c[2]) + 1] = s[int(c[1]): int(c[2]) + 1][::-1]
    if c[0] == "print":
        print "".join(s[int(c[1]): int(c[2]) + 1])
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

a, b = map(int, raw_input().split())
g = gcd(a,b)
l = a*b/g
print l

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

n = int(raw_input())
a = map(int, raw_input().split())
l = a[0]

for i in range(1,len(a)):
    b = a[i]
    g = gcd(l,b)
    l = l*b/g
print l

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

n = int(raw_input())
an = map(int, raw_input())
l = a[0]

for i in range(1,len(a)-1):
    b = a[i]
    g = gcd(l,b)
    l = a*b/g
print l
     

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

n = int(raw_input())
a = map(int, raw_input().split())
l = a[0]

for i in range(1,len(a)):
    b = a[i]
    g = gcd(l,b)
    l = l*b/g
print l
Buggy python submission (verdict: Runtime Error):
a = map(int, raw_input().split())
a.sort()
print (" ".join(map(str a)))

Fixed submission:
a = map(int, raw_input().split())
a.sort()
print (" ".join(map(str, a)))
Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, raw_input().split())
    if not n and not x :
        break
    count = 0
    for i in range(1:n-1):
        for j in range(i+1,n):
            for k in range(j+1, n+1):
                if i+j+k == x :
                    count += 1
    print count

Fixed submission:
while True:
    n, x = map(int, raw_input().split())
    if not n and not x :
        break
    count = 0
    for i in range(1,n-1):
        for j in range(i+1,n):
            for k in range(j+1, n+1):
                if i+j+k == x :
                    count += 1
    print count
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
for i in range(n):
    a[i] = raw_input()

a.sort()

print a[0]

Fixed submission:
n = int(raw_input())
a=["" for i in range(n)]
for i in range(n):
    a[i] = raw_input()

a.sort()

print a[0]
Buggy python submission (verdict: Runtime Error):
n = int(raw_input)
a = map(int, raw_input().split())

for i in range(n, 0):
    print a[i],

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())
a.reverse()
print (" ".join(map(str, a)))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input)
a = map(int, raw_input().split())
a.reverse()
for i in a:
    print i,

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())
a.reverse()
print (" ".join(map(str, a)))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input)
a = map(int, raw_input().split())
print (" ".join(map(str, a.reverse())))

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())
a.reverse()
print (" ".join(map(str, a)))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
a = map(int, raw_input().split())
print (" ".join(map(str, a.reverse())))

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())
a.reverse()
print (" ".join(map(str, a)))
Buggy python submission (verdict: Runtime Error):
while True:
    m, f, r = map(int, raw_input().split())
    if m+f+r == -3:
        break
    if m == -1 or f == -1:
        print "F"
    elif m+f >= 80
        print "A"
    elif m+f >= 65
        print "B"
    elif m+f >= 50
        print "C"
    elif m+f >= 30
        if r >= 50
            print "C"
        else:
            print "D"
    else:
        print "F"

Fixed submission:
while True:
    m, f, r = map(int, raw_input().split())
    if m+f+r == -3:
        break
    if m == -1 or f == -1:
        print "F"
    elif m+f >= 80:
        print "A"
    elif m+f >= 65:
        print "B"
    elif m+f >= 50:
        print "C"
    elif m+f >= 30:
        if r >= 50:
            print "C"
        else:
            print "D"
    else:
        print "F"
Buggy python submission (verdict: Runtime Error):
import sys
w = raw_input().lower()

for t in stdin.sys.read().split():
    if  t == "END_OF_TEXT":
        break
    t.lower()
    count = 0
    if t == w:
        count += 1
    print count

Fixed submission:
w = raw_input().lower()
sum = 0
while True:
    t = raw_input().split()
    if t[0] == "END_OF_TEXT":
        break
    else:
        for ti in t:
            if ti.lower() == w:
                sum += 1
print sum

Buggy python submission (verdict: Runtime Error):
import sys
w = raw_input().lower()

for t in stdin.sys.read().raw_input():
    if  t == "END_OF_TEXT":
        break
    t.lower()
    count = 0
    if t == w:
        count += 1
    print count

Fixed submission:
w = raw_input().lower()
sum = 0
while True:
    t = raw_input().split()
    if t[0] == "END_OF_TEXT":
        break
    else:
        for ti in t:
            if ti.lower() == w:
                sum += 1
print sum
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
a = raw_input().split()

a.sort()

print (" ".join(map(str a)))

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())

a.sort()

print (" ".join(map(str, a)))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
a = map(raw_input().split())

a.sort()

print (" ".join(map(str, a)))

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())

a.sort()

print (" ".join(map(str, a)))

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
a = map(int raw_input().split())

a.sort()

print (" ".join(map(str, a)))

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())

a.sort()

print (" ".join(map(str, a)))
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
s = map(int, raw_input().split())
m = int(raw_input())
t = map(int, raw_input().split())

s.sort()
t.sort()
count = 0

for i in t:
    count += s.find(i)

Fixed submission:
n = int(raw_input())
s = map(int, raw_input().split())
m = int(raw_input())
t = map(int, raw_input().split())

count = 0
for i in t:
    if i in s:
        count += 1

print count
Buggy python submission (verdict: Runtime Error):
stuck = ""
while True:
    a = raw_input().split()
    if a == "quit"
        break
    if a[0] == "push"
        stuck += a[1]
    elif a[0] == "pop"
        stuck.pop()
for i in range(len(stuck))
    print stuck[i]

Fixed submission:
stuck = ""
while True:
    a = raw_input().split()
    if a[0] == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop":
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]

Buggy python submission (verdict: Runtime Error):
stuck = ""
while True:
    a = raw_input().split()
    if a == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop"
        stuck.pop()
for i in range(len(stuck)):
    print stuck[i]

Fixed submission:
stuck = ""
while True:
    a = raw_input().split()
    if a[0] == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop":
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]

Buggy python submission (verdict: Runtime Error):
stuck = ""
while True:
    a = raw_input().split()
    if a == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop"
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]

Fixed submission:
stuck = ""
while True:
    a = raw_input().split()
    if a[0] == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop":
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]

Buggy python submission (verdict: Runtime Error):
stuck = ""
while True:
    a = raw_input().split()
    if a == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop":
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]

Fixed submission:
stuck = ""
while True:
    a = raw_input().split()
    if a[0] == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop":
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]
Buggy python submission (verdict: Runtime Error):
for i in range(1,10): 
  for j in range(1,10): print "%dx%d=%d"%(i,j,i*j)

Fixed submission:
for i in range(1,10): 
  for j in range(1,10): print "%dx%d=%d"%(i,j,i*j)
Buggy python submission (verdict: Runtime Error):
import sys,math
for i in sys.stdin.realines():
	if not i.strip():break
	a,b=map(int,i.split())
	print int(math.log10(a+b))+1

Fixed submission:
import sys
for s in sys.stdin:print len(str(sum(map(int,s.split()))))

Buggy python submission (verdict: Runtime Error):
import sys,math
for i in sys.stdin.realines():
	if not i.strip():break
	a,b=map(int,i.split())
	print int(math.log10(a+b))+1

Fixed submission:
import sys
for s in sys.stdin:print len(str(sum(map(int,s.split()))))
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
for l in range(n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split()) 
	if (x1-x2)/(y1-y2) == (x3-x4)/(y3-y4):
		print 'YES'
	else:
		print 'NO'

Fixed submission:
n = int(raw_input())
for l in range(n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
	if abs((y4-y3)*(x2-x1)-(y2-y1)*(x4-x3))< 1e-10:
		print "YES"
	else:
		print "NO"

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
for l in range(n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split()) 
	if x1 - x2 == 0 and x3 - x4 == 0 :
		print 'YES'
	elif x1 - x2 != 0 and x3 - x4 == 0 :
		print 'NO'
	elif x1 - x2 == 0 and x3 - x4 != 0 :
		print 'NO'	
	else:
		if (x1-x2)/(y1-y2) == (x3-x4)/(y3-y4):
			print 'YES'
		else:
			print 'NO'

Fixed submission:
n = int(raw_input())
for l in range(n):
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
	if abs((y4-y3)*(x2-x1)-(y2-y1)*(x4-x3))< 1e-10:
		print "YES"
	else:
		print "NO"
Buggy python submission (verdict: Runtime Error):
import math
a,b,c=map(float,raw_input().split())
c = c / 180 * math.pi

print "%.10f" % float(a*b*math.sin(c)/2)
print "%.10f" % float(a + b + math.sqrt(a**2 + b**2)*cos(c))
print "%.10f" % float(b*math.sin(c))

Fixed submission:
import math
a,b,c=map(float,raw_input().split())
c = c / 180 * math.pi

print "%.10f" % float(a*b*math.sin(c)/2)
x = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(c))
print "%.10f" % float(a + b + x)
print "%.10f" % float(b*math.sin(c))
Buggy python submission (verdict: Runtime Error):
import sys
def solve():
  for x in sys.stdin:
  a,b = map(int,raw_input().split())
  print a*b,2*a+2*b
  
if __name__ == "__main__":
  solve()

Fixed submission:
input = raw_input().split()
a = int(input[0])
b = int(input[1])
print "%d %d" % (a * b , 2 * (a + b))
Buggy python submission (verdict: Runtime Error):
input = raw_input().split()
a = input[0]
b = input[1]

if (a == b) :
	print "a == b"
elif (a > b) :
	print "a > b"
elif :
	print "a < b"

Fixed submission:
a, b = map(int, raw_input().split(" "))

if (a == b) :
	print "a == b"
elif (a > b) :
	print "a > b"
elif (a < b) :
	print "a < b"
Buggy python submission (verdict: Runtime Error):
while 1
	H , W = map(int , raw_input().split())
	if H == 0 and W == 0:
		break
	print "#" * W
	for h in range(0,H-2):
		s = "#"
		for l in range(0,W-2):
			s += "."
		s += "#"
		print s

	print "#" * W

Fixed submission:
while 1:
	H , W = map(int , raw_input().split())
	if H == 0 and W == 0:
		break
	print "#" * W
	for h in range(0,H-2):
		s = "#"
		for l in range(0,W-2):
			s += "."
		s += "#"
		print s

	print "#" * W
	print
Buggy python submission (verdict: Runtime Error):
while 1 :
	m,f,r = map(int , raw_input().split())
	if m == -1 and f == -1 and r == -1 :
		break
	 elif m == -1 or f == -1:
        print 'F'
   elif m + f >= 80:
       print 'A'
   elif m + f >= 65:
       print 'B'
   elif m + f >= 50:
        print 'C'
   elif m + f >= 30:
       if r >= 50:
           print 'C'
       else:
          print 'D'
	  else:
       print 'F'

Fixed submission:
while 1 :
	m,f,r = map(int , raw_input().split())
	
	s = m + f
	
	if m == f == r == -1 :
		break
	elif m == -1 or f == -1 or s < 30 :
		print "F"
	elif s >= 80 :
		print "A"
	elif s >= 65 :	
		print "B"
	elif s >= 50 : 
		print "C"
	elif s >= 30 and r >= 50 :
		print "C"
	else :
		print "D"

Buggy python submission (verdict: Runtime Error):
while 1 :
  m, f, r = [int(i) for i in raw_input().split()]
	if m == -1 and f == -1 and r == -1 :
		break
	 elif m == -1 or f == -1:
        print 'F'
   elif m + f >= 80:
       print 'A'
   elif m + f >= 65:
       print 'B'
   elif m + f >= 50:
        print 'C'
   elif m + f >= 30:
       if r >= 50:
           print 'C'
       else:
          print 'D'
	  else:
       print 'F'

Fixed submission:
while 1 :
	m,f,r = map(int , raw_input().split())
	
	s = m + f
	
	if m == f == r == -1 :
		break
	elif m == -1 or f == -1 or s < 30 :
		print "F"
	elif s >= 80 :
		print "A"
	elif s >= 65 :	
		print "B"
	elif s >= 50 : 
		print "C"
	elif s >= 30 and r >= 50 :
		print "C"
	else :
		print "D"

Buggy python submission (verdict: Runtime Error):
while 1 :
	m,f,r = map(int , raw_input().split())
	
	s = m + f
	
	if m == f == s == -1 :
		break
	elif m == -1 or f == -1 or s < 30 :
		print "F"
	elif s >= 80 :
		print "A"
	elif s >= 65 :	
		print "B"
	elif s >= 50 : 
		print "C"
	elif s >= 30 and r >= 50 :
		print "C"
	else :
		print "D"

Fixed submission:
while 1 :
	m,f,r = map(int , raw_input().split())
	
	s = m + f
	
	if m == f == r == -1 :
		break
	elif m == -1 or f == -1 or s < 30 :
		print "F"
	elif s >= 80 :
		print "A"
	elif s >= 65 :	
		print "B"
	elif s >= 50 : 
		print "C"
	elif s >= 30 and r >= 50 :
		print "C"
	else :
		print "D"
Buggy python submission (verdict: Runtime Error):
import math
a,b,c=map(float,raw_input().split())
c = c / 180 * math.pi

print "%.10f" % float(a*b*math.sin(c)/2)
x = math.sqrt(a**2 + b**2)*cos(c)
print "%.10f" % float(a + b + x)
print "%.10f" % float(b*math.sin(c))

Fixed submission:
import math
a, b, c = map(float, raw_input().split())
c = c/180*math.pi
 
print a*b*math.sin(c)/2
print a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c))
print b*math.sin(c)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
raw_input()
n = map(int,raw_input().split())
raw_input()
res = 0
for i in map(int,raw_input().split()):
    if i in n :
        res += 1
print res

Fixed submission:
raw_input()
s1 = set(raw_input().split())
raw_input()
s2 = set(raw_input().split())
print (len(s1&s2))
Buggy python submission (verdict: Runtime Error):
# your code goes here
a, b = input().split(" ")
print ("%d %d %.5f" % (int(a)/int(b), int(a)%int(b), float(a)/int(b)))

Fixed submission:
# your code goes here
import math

n = int(input())
for i in range(n):
	xa, ya, ra, xb, yb, rb = [float(x) for x in input().split(" ")]
	distance = math.sqrt((xb-xa)**2 + (yb-ya)**2)

	if distance > ra+rb:
		print(0)
	elif distance < abs(ra-rb):
		if ra > rb:
			print(2)
		elif ra < rb:
			print(-2)
		else:
			print(1)
	elif distance <= ra+rb:
		print(1)
Buggy python submission (verdict: Runtime Error):
while True:
  try:
    (a, b) = map(int, raw_input().split())
    c = a + b
    i = 0
    while c != 0:
      c /= 10
      i += 1
    print i

  except:
    pass:

Fixed submission:
while True:
	try:
		[a, b] = map(int, raw_input().split())
		sum = a + b
		count = 0
		while sum:
			count += 1
			sum /= 10
		print count
	except (EOFError):
		break;
Buggy python submission (verdict: Runtime Error):
while(True):
  n = input()
  if n == 0:
    break;
  sl = 1001
  sh = 0
  ret = 0
  for i in range(n):
    tmp = input()
    sum += tmp
    if tmp < sl:
      sl = tmp
    if tmp > sh:
      sh = tmp
  ret -= (sl + sh)
  print "%d" % (ret/n)

Fixed submission:
while(True):
  n = input()
  if n == 0:
    break;
  sl = 1001
  sh = 0
  ret = 0
  for i in range(n):
    tmp = input()
    ret += tmp
    if tmp < sl:
      sl = tmp
    if tmp > sh:
      sh = tmp
  ret -= (sl + sh)
  print "%d" % (ret/(n-2))
Buggy python submission (verdict: Runtime Error):
(a b) = map(int, raw_input().split())
print (a+b)*2

Fixed submission:
(a, b) = map(int, raw_input().split())
print str(a*b) + ' ' + str((a+b)*2)
Buggy python submission (verdict: Runtime Error):
# coding:utf-8

for i in range(1000):
   printf("Hello World\n")

Fixed submission:
# coding:utf-8

for i in range(1000):
    print("Hello World")
Buggy python submission (verdict: Runtime Error):
# -*- coding;utf-8 -*-

def sieve(n):
    p = 0
    primes = []
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n+1):
        if(is_prime[i]):
            primes.append(i)
            p += 1
            for j in range(i*2,n,i):#iごとに増える
                is_prime[j] = False
    return p

if(__name__ == "__main__"):
    while(True):
        try:
            n = int(input())
        except:
            break
        print(sieve(n) + "\n")

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

def sieve(n):
    p = 0
    primes = []
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n+1):
        if(is_prime[i]):
            primes.append(i)
            p += 1
            for j in range(i*2,n+1,i):#iごとに増える
                is_prime[j] = False
    return p

if(__name__ == "__main__"):
    while(True):
        try:
            n = int(input())
        except:
            break
        print(sieve(n))
Buggy python submission (verdict: Runtime Error):
def run(infile, outfile):
	n = int(infile.readline())
	if n == 0:
		break
	foo(infile,outfile,n)

def foo(infile, outfile, n):
	ax = 0 #a's point
	bx = 0
	for i in range(n):
		a , b = infile.readline().split()
		a = int(a)
		b = int(b)
		if a > b:
			ax += (a + b)
		elif b > a:
			bx += (a + b)
		else:
			assert False
	print >> outfile, ax , bx

if __name__ == "__main__":
	import sys
	run(sys.stdin, sys.stdout)

Fixed submission:
def input_n(inputfile,outputfile):
	while True:
		n = inputfile.readline()
		n = int(n)
		if n == 0:
			break
		battle(inputfile,outputfile,n)

def battle(inputfile,outputfile,n):
	apoint = 0
	bpoint = 0
	for i in range(n):
		a , b = inputfile.readline().split()
		a = int(a)
		b = int(b)
		if a > b:
			apoint += (a + b)
		elif b > a:
			bpoint += (a + b)
		else:
			apoint += a
			bpoint += b
	print >> outputfile, apoint, bpoint

if __name__ == "__main__":
	import sys
	input_n(sys.stdin,sys.stdout)
Buggy python submission (verdict: Runtime Error):
while True:
	students,places = map(int,raw_input().split())
	if students=0 and places~0:
		break
	res = dict(zip(range(places),[0]*places))
	for i in range(students):
		points = map(int,raw_input().split())
		for j in range(places):
			res[j] += points[j]
	for k,v in sorted(res.items(),key=lambda x:x[1], reverse=True):
		print k,

Fixed submission:
while True:
	students,places = map(int,raw_input().split())
	if students == 0 and places == 0:
		break
	res = dict(zip(range(places),[0]*places))
	for i in range(students):
		points = map(int,raw_input().split())
		for j in range(places):
			res[j] += points[j]
	for k,v in sorted(res.items(),key=lambda x:x[1], reverse=True):
		print k+1,
	print

Buggy python submission (verdict: Runtime Error):
while True:
	students,places = map(int,raw_input().split())
	if students == 0 and places =~ 0:
		break
	res = dict(zip(range(places),[0]*places))
	for i in range(students):
		points = map(int,raw_input().split())
		for j in range(places):
			res[j] += points[j]
	for k,v in sorted(res.items(),key=lambda x:x[1], reverse=True):
		print k,
	print "\n"

Fixed submission:
while True:
	students,places = map(int,raw_input().split())
	if students == 0 and places == 0:
		break
	res = dict(zip(range(places),[0]*places))
	for i in range(students):
		points = map(int,raw_input().split())
		for j in range(places):
			res[j] += points[j]
	for k,v in sorted(res.items(),key=lambda x:x[1], reverse=True):
		print k+1,
	print

Buggy python submission (verdict: Runtime Error):
while True:
	students,places = map(int,raw_input().split())
	if students == 0 and places == 0:
		break
	res = dict(zip(range(1,places+1),[0]*places))
	for i in range(students):
		points = map(int,raw_input().split())
		for j in range(1,places+1):
			res[j] += points[j]
	for k,v in sorted(res.items(),key=lambda x:x[1], reverse=True):
		print k,
	print "\n"

Fixed submission:
while True:
	students,places = map(int,raw_input().split())
	if students == 0 and places == 0:
		break
	res = dict(zip(range(places),[0]*places))
	for i in range(students):
		points = map(int,raw_input().split())
		for j in range(places):
			res[j] += points[j]
	for k,v in sorted(res.items(),key=lambda x:x[1], reverse=True):
		print k+1,
	print
Buggy python submission (verdict: Runtime Error):
def run(infile,outfile):
	for line in infile.readline():
		x, y = map(int,line.sprit())
		print >> outfile, x + y

if __name__ == "__main__":
	import sys
	run(sys.stdin, sys.stdout)

Fixed submission:
def run(infile,outfile):
	for line in infile.readlines():
		print >> outfile,sum(map(int,line.rstrip().split()))

if __name__ == "__main__":
	import sys
	run(sys.stdin, sys.stdout)
Buggy python submission (verdict: Runtime Error):
import functools

n = input()
while(n):
    list = []
    bottom_record = [0]*(n+1)

    for i in range(0, n):
        l = map(int, raw_input().split())
        l.append(functools.reduce(lambda x, y: x + y, l))
        bottom_record = [x + y for(x,y) in zip(bottom_record, l)]
        print(' '.join(map(str, l))) 
    print(' '.join(map(str, bottom_record)))
    n = input()

Fixed submission:
n = int(input())
while(n):
    bottom_record = [0]*(n+1)

    for i in range(0, n):
        l = list(map(int, input().split()))
        l.append(sum(l))
        bottom_record = [x + y for(x,y) in zip(bottom_record, l)]
        print(''.join(map('{0:5d}'.format, l))) 
    print(''.join(map('{0:5d}'.format, bottom_record)))
    n = int(input())