Buggy python submission (verdict: Runtime Error):
while 1:
	temp = input()
	if (temp==0):
		break
	N = temp
	a = []
	for i in range(N):
	    a.append(map(int, raw_input().split())+[0])
	a.append([0 for i in range(0,temp+1)])	 
	for i in range(0,temp):#????????¢??????
		for j in range(0,temp):#????????¢??????
			a[i][temp] += a[i][j]
	for k in range(0,temp+1):#????????¢??????
		for l in range(0,temp):#????????¢??????
			a[temp][k] += a[l][k]
	for m in range(temp+1):
		print " ".join(map(str,a[m]))

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
	temp = input()
	if (temp==0):
		break
	N = temp
	a = []
	for i in range(N):
	    a.append(map(int, raw_input().split())+[0])
	a.append([0 for i in range(0,temp+1)])	 
	for i in range(0,temp):#行に関して
		for j in range(0,temp):#列に関して
			a[i][temp] += a[i][j]
	for k in range(0,temp+1):#列に関して
		for l in range(0,temp):#行に関して
			a[temp][k] += a[l][k]
	for m in range(0,temp+1):
		for n in range(0,temp+1):
			sys.stdout.write(str(a[m][n]).rjust(5))
		print ""

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
    import sys
    while 1:
    temp = input()
    if (temp==0):
    break
    N = temp
    a = []
    for i in range(N):
    a.append(map(int, raw_input().split())+[0])
    a.append([0 for i in range(0,temp+1)])	
    for i in range(0,temp):#行に関して
    for j in range(0,temp):#列に関して
    a[i][temp] += a[i][j]
    for k in range(0,temp+1):#列に関して
    for l in range(0,temp):#行に関して
    a[temp][k] += a[l][k]
    for m in range(0,temp+1):
    for n in range(0,temp+1):
    sys.stdout.write(str(a[m][n]).rjust(5))
    print ""

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
    import sys
    while 1:
    temp = input()
    if (temp==0):
    break
    N = temp
    a = []
    for i in range(N):
    a.append(map(int, raw_input().split())+[0])
    a.append([0 for i in range(0,temp+1)])	
    for i in range(0,temp):#行に関して
    for j in range(0,temp):#列に関して
    a[i][temp] += a[i][j]
    for k in range(0,temp+1):#列に関して
    for l in range(0,temp):#行に関して
    a[temp][k] += a[l][k]
    for m in range(0,temp+1):
    for n in range(0,temp+1):
    sys.stdout.write(str(a[m][n]).rjust(5))
    print ""
pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
    import sys
    while 1:
    temp = input()
    if (temp==0):
    break
    N = temp
    a = []
    for i in range(N):
    a.append(map(int, raw_input().split())+[0])
    a.append([0 for i in range(0,temp+1)])	
    for i in range(0,temp):#行に関して
    for j in range(0,temp):#列に関して
    a[i][temp] += a[i][j]
    for k in range(0,temp+1):#列に関して
    for l in range(0,temp):#行に関して
    a[temp][k] += a[l][k]
    for m in range(0,temp+1):
    for n in range(0,temp+1):
    sys.stdout.write(str(a[m][n]).rjust(5))
    print ""
print ""

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
	try:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])	 
		for i in range(0,temp):#????????¢??????
			for j in range(0,temp):#????????¢??????
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):#????????¢??????
			for l in range(0,temp):#????????¢??????
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
	except(RuntimeError):
		pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
    import sys
    while 1:
    try:
    temp = input()
    if (temp==0):
    break
    N = temp
    a = []
    for i in range(N):
    a.append(map(int, raw_input().split())+[0])
    a.append([0 for i in range(0,temp+1)])	
    for i in range(0,temp):#行に関して
    for j in range(0,temp):#列に関して
    a[i][temp] += a[i][j]
    for k in range(0,temp+1):#列に関して
    for l in range(0,temp):#行に関して
    a[temp][k] += a[l][k]
    for m in range(0,temp+1):
    for n in range(0,temp+1):
    sys.stdout.write(str(a[m][n]).rjust(5))
    print ""
    except(RuntimeError):
    pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
	try:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])	 
		for i in range(0,temp):#行に関して
			for j in range(0,temp):#列に関して
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):#列に関して
			for l in range(0,temp):#行に関して
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
	except(RuntimeError):
		pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
    try:
        temp = input()
        if (temp==0):
            break
            N = temp
            a = []
            for i in range(N):
                a.append(map(int, raw_input().split())+[0])
            a.append([0 for i in range(0,temp+1)])	 
            for i in range(0,temp):#行に関して
                for j in range(0,temp):#列に関して
                    a[i][temp] += a[i][j]
            for k in range(0,temp+1):#列に関して
                for l in range(0,temp):#行に関して
                    a[temp][k] += a[l][k]
            for m in range(0,temp+1):
                for n in range(0,temp+1):
                    sys.stdout.write(str(a[m][n]).rjust(5))
                print ""
    except(RuntimeError):
        pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
    try:
        temp = input()
        if (temp==0):
            break
        N = temp
        a = []
        for i in range(N):
            a.append(map(int, raw_input().split())+[0])
        a.append([0 for i in range(0,temp+1)])	 
        for i in range(0,temp):#行に関して
            for j in range(0,temp):#列に関して
                a[i][temp] += a[i][j]
        for k in range(0,temp+1):#列に関して
            for l in range(0,temp):#行に関して
                a[temp][k] += a[l][k]
        for m in range(0,temp+1):
            for n in range(0,temp+1):
                sys.stdout.write(str(a[m][n]).rjust(5))
            print ""
    except(RuntimeError):
        pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
    try:
        temp = input()
        if (temp==0):
            break
        N = temp
        a = []
        for i in range(N):
            a.append(map(int, raw_input().split())+[0])
        a.append([0 for i in range(0,temp+1)])	 
        for i in range(0,temp):#????????¢??????
            for j in range(0,temp):#????????¢??????
                a[i][temp] += a[i][j]
        for k in range(0,temp+1):#????????¢??????
            for l in range(0,temp):#????????¢??????
                a[temp][k] += a[l][k]
        for m in range(0,temp+1):
            for n in range(0,temp+1):
                sys.stdout.write(str(a[m][n]).rjust(5))
            print ""
    except(RuntimeError):
        pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
while 1:
    try:
        temp = input()
        if (temp==0):
            break
        N = temp
        a = []
        for i in range(N):
            a.append(map(int, raw_input().split())+[0])
        a.append([0 for i in range(0,temp+1)])	 
        for i in range(0,temp):#????????¢??????
            for j in range(0,temp):#????????¢??????
                a[i][temp] += a[i][j]
        for k in range(0,temp+1):#????????¢??????
            for l in range(0,temp):#????????¢??????
                a[temp][k] += a[l][k]
        for m in range(0,temp+1):
            for n in range(0,temp+1):
                sys.stdout.write(str(a[m][n]).rjust(5))
            print ""
    except(RuntimeError):
        pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Buggy python submission (verdict: Runtime Error):
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])	 
		for i in range(0,temp):#????????¢??????
			for j in range(0,temp):#????????¢??????
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):#????????¢??????
			for l in range(0,temp):#????????¢??????
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass

Fixed submission:
import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass