Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = []

for i in range(li[0]):
    mtx[i] = list(map(int,input().split()))
    print(mtx[i],sum(mtx[i]))
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


Fixed submission:
l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = []

for i in range(li[0]):
    mtx[i] = list(map(int,input().split()))
    print(mtx,end='')
    print(sum(mtx[i]))
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


Fixed submission:
l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = []

for i in range(li[0]):
    a = input()
    mtx[i] = list(map(int,a.split()))
    print(mtx,end='')
    print(' ' ,sum(mtx[i]),sep='')
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


Fixed submission:
l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = []

for i in range(li[0]):
    a = input()
    mtx[i] = list(map(int,a.split()))
    print(a,end='')
    print(' ' ,sum(mtx[i]),sep='')
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


Fixed submission:
l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = [0 for _ in range(li[1]+1)]

for i in range(li[0]):
    a = input()
    mtx[i] = list(map(int,a.split()))
    print(a,end='')
    print(' ' ,sum(mtx[i]),sep='')
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


Fixed submission:
l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))