Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func maxValue(p []int) int {
	highest := 0
	for i := 0; i < len(p); i++ {
		if p[i] > highest {
			highest = p[i]
		}
	}
	return highest
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		n := nextInt()
		m := nextInt()
		if n == 0 && m == 0 {
			break
		}

		pSum := make([]int, n)
		for i := 0; i < m; i++ {
			for j := 0; j < n; j++ {
				pSum[j] += nextInt()
			}
		}
		fmt.Println(maxValue(pSum))
	}
}

Python: for i in range(110):
    x,y = map(int,input().split()) #xは生徒,yは科目
    if x == y == 0:
        break
    else:
        a = [0]*x
        for j in range(y):
            ls = list(map(int,input().split()))
            for _ in range(x):
                a[_] += ls[_]
        print(max(a))

Python: def main():
    import sys
    from itertools import chain
    while True:
        n, m = map(int, sys.stdin.readline().split())
        if n == m == 0:
            break

        A = list(chain.from_iterable(map(int, sys.stdin.readline().split()) for _ in range(m)))
        ans = 0
        for i in range(n):
            sm = sum(A[i::n])
            if ans < sm:
                ans = sm
        print(ans)

if __name__ == '__main__':
    main()

Python: # coding=utf-8

###
### for python program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    def pnum_check(self, n):
        if (n==1):
            return False
        elif (n==2):
            return True
        else:
            for x in range(2,n):
                if(n % x==0):
                    return False
            return True

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")

def printA(A):
    N = len(A)
    for i, n in enumerate(A):
        print(n, end='')
        if i != N-1:
            print(' ', end='')
    print()

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

while True:
    N, M = [int(x) for x in input().split()]
    if N==0 and M==0:
        break
    P = []
    for i in range(M):
        P.append([int(x) for x in input().split()])

    A = []
    for i in range(N):
        temp = 0
        for j in range(M):
            temp += P[j][i]    
        A.append(temp)

    print(max(A))

Python: while True:
    n, m = map(int, input().split())
    if n+m==0 : break
    a = [list(map(int,input().split())) for i in range(m)]
    for i in range(1, m):
        for j in range(n):
            a[i][j] += a[i-1][j]
    print(max(a[m-1]))

Python: #!/usr/bin/python3

import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys


def main():
    while True:
        N, M = read_ints()
        if (N, M) == (0, 0):
            break
        P = [read_ints() for _ in range(M)]
        print(solve(N, M, P))


def solve(N, M, P):
    T = [[P[j][i] for j in range(M)] for i in range(N)]
    return max([sum(t) for t in T])


###############################################################################
# AUXILIARY FUNCTIONS

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Python: # -*- coding: utf-8 -*-
"""
期末試験の成績
https://onlinejudge.u-aizu.ac.jp/challenges/sources/ICPC/Prelim/1632

"""
import sys


def solve(n, m):
    scores = [[int(x) for x in input().split()] for _ in range(m)]
    return max([sum(z) for z in zip(*scores)])


def main(args):
    while True:
        n, m = map(int, input().split())
        if n == 0 and m == 0:
            break
        ans = solve(n, m)
        print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: scores = [[0] * 51 for i in range(1001)]

while(1):
    try:
        n,m = (int(x) for x in input().split())
        if n == 0:break
        for i in range(0,m):
            scores[i] = list(int(x) for x in input().split())
            
        maxSum = 0
        for i in range(0,n):
            sum = 0
            for j in range(0,m):
                sum += scores[j][i]
            maxSum = max(maxSum,sum)
        print(maxSum)
    except:
        break

Python: while True:
    n,m = map(int,input().split())
    if n == m == 0:
        break
    score = [0 for i in range(n)]
    for i in range(m):
        hokan = list(map(int,input().split()))
        for j in range(n):
            score[j] += hokan[j]
    score.sort(reverse = True)
    print(score[0])

Python: while 1:
    N, M = map(int, input().split())
    if N == 0:
        break
    S = [list(map(int, input().split())) for i in range(M)]
    ans = 0
    for i in range(N):
        ans = max(ans, sum(S[j][i] for j in range(M)))
    print(ans)

Python: while True:
    n=[int(e) for e in input().split()]

    if(n[0]==0)and(n[1]==0):
        break

    m=[[0 for i in range(n[0])] for j in range(n[1]+1)]
    
    for j in range(n[1]):
        m[j]=[int(e) for e in input().split()]

    for k in range(n[0]):
        score=0
        for j in range(n[1]):
            score=m[j][k]+score
        m[(n[1])][k]=score
    
    max_=m[(n[1])][0]
    for k in range(n[0]):
        if max_<m[(n[1])][k]:
            max_=m[(n[1])][k]

    print(max_)

Python: while True:
	n,m=map(int,input().split())
	if n==m==0:
		break
	else:
		score=[0]*n
		for i in range(m):
			p=list(map(int,input().split()))
			for j in range(n):
				score[j]+=p[j]
		print(max(score))