#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int p[N], n, m, a[N], x[N], pos[N], cnt;
bool mark[5 * N];
vector<int> adj[N];
void dfs(int v) {
  static int cnt = n;
  mark[v] = true;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u]) dfs(u);
  }
  x[--cnt] = v, pos[v] = cnt;
}
bool cmp(int x, int y) { return a[x] < a[y]; }
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) p[i] = i;
  cnt = m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> a[j];
    sort(p, p + m, cmp);
    int p1 = 0;
    while (p1 < m && a[p[p1]] == -1) p1++;
    int p2 = p1, flag = false;
    while (p1 < m) {
      while (p2 < m && a[p[p1]] == a[p[p2]]) {
        if (flag) adj[cnt].push_back(p[p2]);
        p2++;
      }
      cnt++, flag = true;
      while (p1 < p2) {
        adj[p[p1]].push_back(cnt);
        p1++;
      }
    }
  }
  n = cnt;
  for (int i = 0; i < n; i++)
    if (!mark[i]) dfs(i);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (int)adj[i].size(); j++)
      if (pos[i] > pos[adj[i][j]]) {
        cout << -1 << '\n';
        return 0;
      }
  for (int i = 0; i < n; i++)
    if (x[i] < m) cout << x[i] + 1 << ' ';
  cout << '\n';
  return 0;
}
