#include <bits/stdc++.h>
using namespace std;
vector<int> vv[1000000];
int top;
int du[1000000];
struct node {
  int val, biao;
  bool friend operator<(node a, node b) { return a.val < b.val; }
} s[100100];
vector<int> ans;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  top = m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) scanf("%d", &s[j].val), s[j].biao = j;
    sort(s, s + m);
    for (int j = 0; j < m; j++) {
      if (s[j].val == -1) continue;
      if (!j || s[j].val != s[j - 1].val) top++;
      vv[s[j].biao].push_back(top + 1), du[top + 1]++;
      vv[top].push_back(s[j].biao), du[s[j].biao]++;
    }
    top++;
  }
  queue<int> q;
  for (int i = 0; i < top; i++)
    if (!du[i]) q.push(i);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    if (x < m) ans.push_back(x);
    int len = vv[x].size();
    for (int i = 0; i < len; i++)
      if (--du[vv[x][i]] == 0) q.push(vv[x][i]);
  }
  if (ans.size() == m) {
    for (int i = 0; i < m - 1; i++) printf("%d ", ans[i] + 1);
    printf("%d\n", ans[m - 1] + 1);
  } else
    puts("-1");
}
