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++: // https://atcoder.jp/contests/agc037/submissions/6956246
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define chmax(a, b) a = (a >= b ? a : b)
#define chmin(a, b) a = (a <= b ? a : b)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define ceil(a, b) a / b + !!(a % b)
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    while (cin >> n && n) {
        int m;
        cin >> m;
        int p[m][n];
        rep(i, m) rep(j, n) cin >> p[i][j];
        
        int ans = -inf;
        rep(j, n) {
            int sum = 0;
            rep(i, m) sum += p[i][j];
            chmax(ans, sum);
        }
        
        cout << ans << endl;
    }
}

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

int n, m;
int a[50][1000];

int main()
{
	cin >> n >> m;

	while (n != 0 && m != 0) {
		int t = 0;

		for (int i = 0; i < m; i++)
			for (int j = 0; j < n; j++)
				cin >> a[i][j];

		for (int j = 0; j < n; j++) {
			int s = 0;

			for (int i = 0; i < m; i++)
				s += a[i][j];

			t = max(t, s);
		}
		cout << t << endl;

		cin >> n >> m;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;i < (n);(i)++)
#define ll long long

using namespace std;

// input
int n,m;
int p[1001][1001];

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int ans;
  while(true) {
    cin >> n >> m;
    if(n == 0) break;
    rep(i,m) {
      rep(j,n) cin >> p[i][j];
    }

    ans = 0;
    rep(i,n) {
      int tmp = 0;
      rep(j,m) tmp += p[j][i];
      ans = max(ans,tmp);
    }

    cout << ans << endl;
  }
}

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

#define int long long
#define REP(i, l, r) REPEAT(i,l,r,true) // [l, r)
#define rep(i, n) REP(i,0,n)           // [0, n)
#define REPEAT(i, l, r, condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#ifdef LOCAL
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n, l, r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)
#else
#define show(...) true
#define showlr(n,l,r) true
#endif

#define YN(condition) puts((condition)?"YES":"NO")
#define Yn(condition) puts((condition)?"Yes":"No")
#define yn(condition) puts((condition)?"yes":"no")
#define YES puts("YES")
#define Yes puts("Yes")
#define yes puts("yes")
#define NO  puts("NO")
#define No  puts("No")
#define no  puts("no")

#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int, int>;

struct io {
    io() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout.tie(0);
        cout << fixed << setprecision(20);
    }
} io;

template<class T>
istream &operator>>(istream &is, vector<T> &v) {
    for (T &e:v)is >> e;
    return is;
}

template<class T>
ostream &operator<<(ostream &os, vector<T> v) {
    os << "{";
    for (T &e:v)os << e << (v.size() - (int) (&e - &v[0]) > 1 ? ", " : "");
    os << "}";
    return os;
}

void _DEBUG() {}

template<typename H, typename... T>
void _DEBUG(H a, T...b) {
    cerr << a << (sizeof...(b) ? "," : "\n");
    _DEBUG(b...);
}

inline void in() {}

template<typename H, typename... T>
void in(H &a, T &... b) {
    cin >> a;
    in(b...);
}

inline void out() {}

template<typename H, typename... T>
void out(H a, T... b) {
    cout << a << (sizeof...(b) ? " " : "\n");
    out(b...);
}

template<class T>
void resz(int n, T &v) { v.resize(n); }

template<class H, class... T>
void resz(int n, H &a, T &... b) {
    a.resize(n);
    resz(n, b...);
}

template<typename V, typename H>
void resize(vector<V> &v, const H a) { v.resize(a); }

template<typename V, typename H, typename... T>
void resize(vector<V> &v, const H &a, const T... b) {
    v.resize(a);
    for (auto &v:v) resize(v, b...);
}

template<class T, class U>
void chmin(T &t, const U u) { if (t > u) t = u; }

template<class T, class U>
void chmax(T &t, const U u) { if (t < u) t = u; }

const int INF = 1LL << 55;
const int MOD = 1000000007;
const double EPS = 1e-8;

/*------------end of definitions------------*/

int N, M;

void solve() {
    vector<vi> V(N, vi(M));
    rep(i, M) {
        rep(j, N) {
            in(V[j][i]);
        }
    }
    int res = -1;
    rep(i, N) {
        int tmp = 0;
        for_each(all(V[i]), [&tmp](int x) { tmp += x; });
        chmax(res, tmp);
    }

    out(res);
}

signed main() {

    while (in(N, M), N) {
        solve();
    }

    return 0;
}

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

int n=1, m=1;

int main() {
    for (;n+m != 0;) {
        cin >> n >> m;
        int a[n*m];
        for (int i=0; i<n*m; i++) cin >> a[i];
        int sum[n];
        for (int i=0; i<n; i++) sum[i]=0;
        for (int i=0; i<n; i++) {
            for (int j=0; j<m; j++) sum[i] += a[j*n+i];
        }
        sort (sum , sum + n);
        if (n+m !=0) cout << sum[n-1] << endl;
    }
}

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

typedef long long int ll;


int main()
{
    ll n, m;
    vector<ll> ans;
    while(1){
        cin >> n >> m;
        if(n == 0) break;
        vector<vector<ll> > p(m,vector<ll>(n));
        ll anst = 0;
        for(ll i = 0;i < m;i++){
            ll t = 0;
            for(ll j = 0;j < n;j++){
                cin >> p[i][j];
            }
        }

        for(ll i = 0;i < n;i++){
            ll t = 0;
            for(ll j = 0;j < m;j++){
                t += p[j][i];
            }
            anst = max(anst, t);
        }
        ans.push_back(anst);
    }

    for(ll i = 0;i < ans.size();i++){
        cout << ans[i] << "\n";
    }

    return 0;
}

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

#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()

using namespace std;

int main() {
    while (true) {
        int n, m;
        cin >> n >> m;
        if (n == 0)
            break;
        vector<int> scores(n, 0);
        REP(i, m) REP(j, n) {
            int p;
            cin >> p;
            scores[j] += p;
       }
       cout << *max_element(all(scores)) << endl;
    }
    return 0;
}

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

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

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

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

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