#include <bits/stdc++.h>
using namespace std;
vector<int> G[300100];
pair<int, int> pool[300100];
int mark[300100];
int n, m, l;
vector<int> ss;
bool dfs(int v) {
  if (mark[v] == 1) return false;
  if (mark[v] == 2) return true;
  mark[v] = 1;
  for (int i = 0; i < G[v].size(); i++) {
    if (mark[G[v][i]] == 1 || !dfs(G[v][i])) return false;
  }
  mark[v] = 2;
  ss.push_back(v);
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  l = m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int u;
      cin >> u;
      pool[j] = make_pair(u, j);
    }
    sort(pool, pool + m);
    int ii = 0;
    int vv = -1;
    while (ii < m) {
      int jj = ii;
      while (jj < m && pool[jj].first == pool[ii].first) jj++;
      if (vv != -1)
        for (int j = ii; j < jj; j++) G[vv].push_back(pool[j].second);
      if (jj != m && pool[ii].first != -1) {
        vv = l++;
        for (int j = ii; j < jj; j++) G[pool[j].second].push_back(vv);
      }
      ii = jj;
    }
  }
  memset(mark, 0, sizeof mark);
  for (int i = 0; i < l; i++)
    if (!dfs(i)) {
      cout << -1;
      return 0;
    }
  for (int i = ss.size() - 1; i >= 0; i--)
    if (ss[i] < m) cout << ss[i] + 1 << " ";
}
