import javax.swing.text.Style;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class NickyEnMark {
	static class Item {
		int n;
		int score;

		public Item(int n) {
			this.n = n;
			this.score = 0;
		}
	}

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int k = scanner.nextInt();
		Item[] pos = new Item[n];
		for (int j = 0; j < n; j++) {
			pos[j] = new Item(j);
		}

		for (int i = 0; i < k; i++) {
			for (int j = 0; j < n; j++) {
				int m = scanner.nextInt() - 1;
				pos[m].score += j;
			}
		}

		Arrays.sort(pos, (o1, o2) -> o1.score - o2.score);

		for (int j = 0; j < n; j++) {
			if (j > 0) {
				System.out.print(" ");
			}
			System.out.print(pos[j].n + 1);
		}

		System.out.println();
	}
}
