import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
 
void main() {
    int n, m;
    while (readf("%d %d\n", &n, &m), n || m) {
        int[] z = new int[m];
        foreach (i; 0 .. n) {
            int[] x = readln.chomp.split(" ").map!(to!int).array;
            foreach (j; 0 .. m) {
                z[j] += x[j];
            }
        }
        alias Tuple!(int, int) P;
        P[] p;
        foreach (i; 0 .. m) {
            p ~= P(i + 1, z[i]);
        }
        p.sort!"a[1] > b[1]";
        writefln("%(%s %)", p.map!("a[0]"));
    }
}