#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int n, m, doing[100010], buf[100010], ans[100010], num, lb, ub, cc;
vector<int> g[200010];
int vis[200010];
bool sot(int x, int y) { return buf[x] < buf[y]; }
bool dfs(int pla) {
  vis[pla] = 1;
  for (int i = 0; i < g[pla].size(); i++) {
    if (vis[g[pla][i]] == 1) return false;
    if (!vis[g[pla][i]] && (!dfs(g[pla][i]))) return false;
  }
  vis[pla] = 2;
  ans[cc] = pla;
  cc++;
  return true;
}
int main() {
  cin >> n >> m;
  num = m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> buf[j];
      doing[j] = j;
    }
    sort(doing, doing + m, sot);
    for (lb = 0; lb < m && buf[doing[lb]] == (-1); lb++)
      ;
    for (num++; lb < m; lb += ub) {
      for (ub = 0; lb + ub < m && buf[doing[lb]] == buf[doing[lb + ub]]; ub++) {
        g[num - 1].push_back(doing[lb + ub]);
        g[doing[lb + ub]].push_back(num);
      }
      num++;
    }
  }
  for (int i = 0; i < num; i++) {
    if (!vis[i] && (!dfs(i))) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = num - 1; i >= 0; i--)
    if (ans[i] < m) cout << ans[i] + 1 << " ";
  cout << endl;
  return 0;
}
