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 <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    while (cin >> n >> m, n + m) {
        vector<int> sum(n, 0);
        REP(i, 0, m) {
            REP(j, 0, n) {
                int p;
                cin >> p;
                sum[j] += p;
            }
        }
        int ans = 0;
        REP(i, 0, n) {
            ans = max(sum[i], ans);
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    while(1){
        cin>>n>>m;
        if(n==0) break;
        int P[m][n];
        for(int i=0;i<m;i++){
            for(int j=0;j<n;j++){
                cin>>P[i][j];
            }
        }
        int sum[n];
        for(int j=0;j<n;j++){
            sum[j]=0;
            for(int i=0;i<m;i++){
                sum[j]+=P[i][j];
            }
        }
        int max=0;
        for(int j=0;j<n;j++){
            if(max<sum[j]) max=sum[j];
        }
        cout<<max<<endl;
    }
}

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

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    while(cin >> n >> m && n && m){
        vector<vector<int>> p(n, vector<int>(m));
        for(int i = 0; i < m; i++){
            for(int j = 0; j < n; j++){
                cin >> p[j][i];
            }
        }
        int ans = 0;
        for(auto&& i : p){
            ans = max(ans, accumulate(begin(i), end(i), 0));
        }
        cout << ans << "\n";
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int a[1001][1001];
int main()
{
    int n,m,MAX;
    while(scanf("%d%d",&n,&m)&&(n||m))
    {
        MAX=0;
        for(int i=0; i<m; i++)
            for(int j=0; j<n; j++)
                scanf("%d",&a[i][j]);
        for(int i=0; i<n; i++)
        {
            int sum=0;
            for(int j=0; j<m; j++)
                sum+=a[j][i];
            MAX=max(MAX,sum);
        }
        printf("%d\n",MAX);
    }
    return 0;
}

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

int main() {
  while (true) {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> p(m, vector<int>(n));
    for (int j = 0; j < m; ++j)
      for (int k = 0; k < n; ++k)
        cin >> p[j][k];

    if (n == 0 && m == 0)
      break;

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

    cout << ans << endl;
  }
}

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

#define N 1000

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

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

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

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

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 1010

int mat[maxn][maxn];

void solve() {
    int n, m;
    while (cin >> n >> m and n and m) {

        int mx = 0;
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                cin >> mat[i][j];
                if (i != 0)
                    mat[i][j] += mat[i - 1][j];
                if (i == m - 1)
                    mx = max(mx, mat[i][j]);
            }
        }
        cout << mx << endl;
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll n, m;
  while (cin >> n >> m) {
    if (n==0 && m==0) {
      break;
    } else {
      vector <ll> v(n, 0);
      rep(i, m) {
        rep(j, n) {
          ll a;
          cin >> a;
          v.at(j) += a;
        }
      }
      ll res = 0;
      rep(i, n) {
        res = max(res, v.at(i));
      }
      cout << res << endl;
    }
  }
}

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