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))
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    while(cin >> n >> m){
        if(n == 0 && m == 0)return 0;
        vector<int> vec(n);
        for(int i = 0;i < m;i++){
            for(int j = 0;j < n;j++){
                int c;cin >> c;
                vec.at(j) += c;
            }
        }
        cout<<*max_element(vec.begin(), vec.end())<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    while(true){
        int n,m; cin >> n >> m;
        if(n == 0)break;
        int sum[n] = {};
        rep(i,m){
            int p[n];
            rep(i,n){
                cin >> p[i];
                sum[i] += p[i];
            }
        }
        int ans = 0;
        rep(i,n)ans = max(ans, sum[i]);
        cout << ans << endl;    
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
          int n,m;
          int i,j;
          while(1){
                    int sc;
                    int ans=0;
                    cin >> n >>m;
                    if(!n&&!m) break;
                    vector <int>sum(n);
                    for(i=0;i<m;i++){
                              for(j=0;j<n;j++){
                                        cin >> sc;
                                        sum[j]+=sc;
                              }
                    }
                    for(i=0;i<n;i++)ans = max(ans, sum[i]);
                    cout <<ans<<endl;
          }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    while(1){
        int n,m;
        cin >> n >> m;
        if(n == 0) break;

        vector<int> p(n, 0);
        for(int i=0; i<m; i++){
            for(int j=0; j<n; j++){
                int a;
                cin >> a;
                p[j] += a;
            }
        }
        cout << *max_element(p.begin(), p.end()) << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<cctype>
#include<string>

using namespace std;

int main()
{
  int n,m;

  while(1){
    
    int high=0,p[50][1000];

    cin>>n>>m;
    if(n==0 && m==0)return 0;
    for (int i=0;i<m;i++){
      for(int j=0;j<n;j++){
	cin>>p[i][j];
      }
    }

    for (int i=0;i<n;i++){
      int s=0;
      for(int j=0;j<m;j++){
	s+=p[j][i];
      }
      if(high<s){
	high=s;
	}
    }
    cout<<high<<endl;
  }
      return 0;
  
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
	while(true)
	{
		int n,m;
		scanf("%d %d", &n, &m);
		if(n==0 && m==0) break;
		int in;
		long long scores[n]={0};
		for(int i=0;i<m;i++)
		{
			for(int j=0;j<n;j++)
			{
				scanf("%d", &in);
				scores[j]+=in;
			}
		}
		long long highest=-1;
		for(int i=0;i<n;i++) if(scores[i]>highest) highest = scores[i];
		printf("%lld\n", highest);
	}	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

#define REP(i, n) for(int i = 0; i < n; i++)
#define VREP(vec, vecs) for(auto& vec : vecs)

using namespace std;
typedef long long ll;

int main() {
	int n, m, tmp;

	while (true) {
		cin >> n >> m;
		if (!n && !m) break;

		vector<ll> count(n);

		REP(i, m) REP(j, n) {
			cin >> tmp;
			count[j] += tmp;
		}
		ll ans = 0;
		VREP(cur, count) ans = max(ans, cur);

		cout << ans << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int n, m;
int p[1005][1005] = {0};

int solve();

int main() {
  while(1) {
    cin >> n >> m;
    if(n + m == 0) break;
    for(int i = 0; i < m; ++i)
      for(int j = 0; j < n; ++j) cin >> p[i][j];
    cout << solve() << endl;
  }
  return 0;
}

int solve() {
  int ans = 0;
  for(int i = 0; i < n; ++i) {
    int now = 0;
    for(int j = 0; j < m; ++j) now += p[j][i];
    ans = max(now, ans);
  }
  return ans;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	while(1){
		int n,m; cin >> n >> m;
		if(n==0&&m==0)break;
		int ans=0;
		int a[m][n];
		for(int i=0;i<m;i++){
			for(int j=0;j<n;j++){
				cin >> a[i][j];
			}
		}
		for(int i=0;i<n;i++){
			int sum=0;
			for(int j=0;j<m;j++){
				sum+=a[j][i];
			}
			ans=max(ans,sum);
		}
		cout << ans << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int N,M;
main(){
    while(cin>>M>>N,N){
        vector<int>s(M);
        int ans=0;
        for(int i=0;i<N;i++){
            for(int j=0;j<M;j++){
                int a;cin>>a;ans=max(ans,s[j]+=a);
            }
        }cout<<ans<<endl;
    }
}

C++: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 1005


int N,M;
int table[SIZE];

void func(){

	for(int i = 0; i < N; i++){

		table[i] = 0;
	}

	int tmp;

	for(int loop = 0; loop < M; loop++){
		for(int i = 0; i < N; i++){

			scanf("%d",&tmp);
			table[i] += tmp;
		}
	}

	int ans = 0;

	for(int i = 0; i < N; i++){

		ans = max(ans,table[i]);
	}

	printf("%d\n",ans);
}

int main(){

	while(true){

		scanf("%d %d",&N,&M);
		if(N == 0 && M == 0)break;

		func();
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef double D;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
 
#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d %d",&x,&y)
#define rl(x) scanf("%lld",&x)
#define rl2(x,y) scanf("%lld %lld",&x,&y)
#define wd(x) printf("%d" ,x)
#define wd2(x,y) printf("%d %d",x,y)
#define wl(x) printf("%lld",x)
#define wl2(x,y) printf("%lld %lld",x,y)
#define PC(x) putchar(x)
#define GC() getchar()
#define NL printf("\n")
#define SP printf(" ")
 
#define F first
#define S second
#define MP make_pair
#define PB push_back

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define fr(i,s,e) for(int i=s;i<e;i++)
#define frl(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(int i=s-1;i>=e;i--)
#define frv(i,a) for(int i = 0;i<(int)a.size();i++)
#define frvr(i,a) for(int i = a.size()-1;i>=0;i--)
#define tr(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end();i++)

#define mod 1000000007
#define maxn 100009
#define maxr 100009
int main(){
	ll n,m;
	while(rl2(n,m),n,m)
	{
		if(n==0&&m==0)
			break;
		//vector<vector<ll>> arr(50,vector<ll>(1000));
		ll arr[50][1000];
		fr(i,0,m)
			fr(j,0,n)
				rl(arr[i][j]);
		ll mx=0;
		fr(i,0,n)
		{
			ll sum=0;
			fr(j,0,m)
			{
				sum+=arr[j][i];
			}
			mx=max(mx,sum);
		}
		wl(mx);
		NL;
	}

	return 0;
}