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<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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    int n,m;
    while(cin>>n>>m){
        if(n+m==0)break;
        vector<int> sum(n,0);
        for(int i=0;i<m;i++){
            for(int j=0;j<n;j++){
                int score;cin>>score;
                sum[j]+=score;
            }
        }
        cout<<(*max_element(sum.begin(),sum.end()))<<endl;
    }
}

C++: #include<iostream>
#include<algorithm>
#define int long long
using namespace std;
int a[1010], n, m, p, ans;
signed main() {
	while (cin >> n >> m, n) {
		for (int j = 1; j <= n; j++)a[j] = 0; ans = 0;
		for (int i = 1; i <= m; i++) {
			for (int j = 1; j <= n; j++) {
				cin >> p; a[j] += p;
				if (i == m)ans = max(ans, a[j]);
			}
		}cout << ans << endl;
	}
}

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

using Int = long long;
using ll = long long;

template<class T1, class T2> inline void chmin(T1 &a, T2 b){if(a > b) a = b;}
template<class T1, class T2> inline void chmax(T1 &a, T2 b){if(a < b) a = b;}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  Int n,m;
  while(cin>>n>>m,n||m){
    vector<Int> bs(n,0);
    for(Int i=0;i<m;i++){
      for(Int j=0;j<n;j++){
        Int x;
        cin>>x;
        bs[j]+=x;
      }
    }
    cout<<*max_element(bs.begin(),bs.end())<<endl;
  }

  return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <fstream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define sz size()
#define endl "\n"
#define print(X) cout << (X) << "\n"
// // #define input(X) getline(cin,X)
static const ll  INF = 1e9+7;
static const ll INFL = 1e18+7;
ll n,m,l, p;
string s,t;
ll d[200010],e[200010],dp[1001][1001];
char field[202][202];

int main(){
	while(cin >> n >> m, n){
		int ans = 0;
		rep(i,0,m)
			rep(j,0,n)
				cin >> dp[i][j];
		
		rep(i,0,n){
			int total = 0;
			rep(j,0,m)total += dp[j][i];
			ans = max(ans, total);
		}
		print(ans);
	}
	return 0;
}

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

int main(void){
  for(;;){
    int n, m;
    cin >> n >> m;
    if(n == 0 && m == 0){ return 0; }

    int p[m][n];
    for(int j = 0 ; j < m ; j++){
      for(int k = 0 ; k < n ; k++){
	cin >> p[j][k];
      }
    }

    int sum[n];
    for(int k = 0 ; k < n ; k++){
      sum[k]=0;
      for(int j = 0 ; j < m ; j++){
	sum[k] += p[j][k];
      }
    }

    int max=-1;
    for(int k = 0 ; k < n ; k++){
      if(max < sum[k]){
	max = sum[k];
      }
    }

    cout << max << endl;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};



int main(){
    int n,m;
    while(cin >> n >> m,n){
        int ans=0;
        vector<int> a(n);
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                int s;cin >> s;
                a[j]+=s;
            }
        }
        for (int i = 0; i < n; i++) {
            ans=max(ans,a[i]);
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int maxn = 1100;
int a[maxn];
int main(){
	int n, m;
	//freopen("in.txt", "r", stdin);
	while(cin >> n >> m){
		memset(a, 0, sizeof a);
		if (n == 0 && m == 0) break;
		int ans = -1;
		for(int i = 0; i < m; i++){
			for(int j = 0; j < n; j++){
				int temp; cin >> temp;
				a[j] += temp;
			}
		}
	//sort(a, a + n, less<int>());
	for(int i = 0; i < n; i++){
		ans = max (ans, a[i]);
	}
	printf("%d\n", ans);
}
}