import java.io.*;
import java.util.*;

public class table_av_wa1 {

	FastScanner in;
	PrintWriter out;
	final String fileName = "table".toLowerCase();
	
	int[] solve(int[][] a) {
		int n = a.length, m = a[0].length;

		final int[] countFalls = new int[m];
		for (int j = 0; j < m; j++) {
			for (int i = 0; i < n - 1; i++) {
				if (a[i][j] > a[i + 1][j]) {
					countFalls[j]++;
				}
			}
		}
		
		Integer[] ids = new Integer[m];
		for (int i = 0; i < m; i++) {
			ids[i] = i;
		}

		Arrays.sort(ids, new Comparator<Integer>() {
			@Override
			public int compare(Integer o1, Integer o2) {
				return Integer.compare(countFalls[o1], countFalls[o2]);
			}
		});
		
		int[] result = new int[m];
		for (int i = 0; i < m; i++) {
			result[i] = ids[i];
		}
		
		if (check(result, a, 0, 0, n)) {
			return result;
		} else {
			return null;
		}
	}
	
	private boolean check(int[] perm, int[][] a, int pos, int l, int r) {
		if (pos == a[0].length || l + 1 == r) {
			return true;
		}

		int col = perm[pos];

		for (int i = l; i < r;) {
			int j = i;
			while (j < r && a[i][col] == a[j][col]) {
				j++;
			}

			if (j < r && a[j - 1][col] > a[j][col]) {
				return false;
			}
			boolean ok = check(perm, a, pos + 1, i, j);
			if (!ok) {
				return false;
			}

			i = j;
		}
		return true;
	}

	void run() {
		try {
			in = new FastScanner(fileName + ".in");
			out = new PrintWriter(fileName + ".out");
			int n = in.nextInt(), m = in.nextInt();
			int[][] a = new int[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					a[i][j] = in.nextInt();
				}
			}
			int[] perm = solve(a);
			if (perm == null) {
				out.println(-1);
			} else {
				for (int i = 0; i < m; i++) {
					out.print(perm[i] + 1);
					if (i + 1 == m) {
						out.println();
					} else {
						out.print(" ");
					}
				}
			}
			out.close();

		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	public static void main(String[] args) {
		new table_av_wa1().run();
	}
}
