#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;

int main()
{
	int n,m,set;
	while(cin>>n>>m && n)
	{
		int count[10000]={};
		int number[10000]={};	

		rep(i,m)number[i]=i+1;
		rep(i,n)
		{
			rep(j,m)
			{
				cin>>set;
				count[j]+=set;
			}
		}
		rep(i,m)
		{
			rep_to(i,j,m)
			{
				if(count[i]<count[j])
				{
					swap(count[j],count[i]);
					swap(number[j],number[i]);
				}
				else if(count[i]==count[j] && number[i]>number[j])
					swap(number[j],number[i]);
			}
		}
		rep(i,m)
		{
			cout<<number[i];
			if(i<m-1)cout<<" ";
			else cout<<endl;
		}
	}
	return 0;
}