#include <bits/stdc++.h>
using namespace std;
int n, m;
int data[105000], num[105000], w[105000], cnt[105000];
pair<int, int> mat[105000];
queue<int> que;
bool in_que[105000];
vector<int> ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n * m; i++) {
    scanf("%d", &data[i]);
    mat[i].first = data[i];
    mat[i].second = i % m;
  }
  memset(in_que, true, sizeof(in_que));
  for (int i = 0; i < n; i++) {
    sort(mat + i * m, mat + i * m + m);
    cnt[i] = 0;
    while (cnt[i] < m && mat[i * m + cnt[i]].first == -1) {
      if (++num[mat[i * m + cnt[i]].second] == n)
        ans.push_back(mat[i * m + cnt[i]].second);
      cnt[i]++;
    }
    que.push(i);
  }
  while (!que.empty()) {
    int i = que.front();
    que.pop();
    int j = cnt[i];
    while (j < m && mat[i * m + j].first == mat[i * m + cnt[i]].first) {
      j++;
      w[i]++;
    }
    j = cnt[i];
    while (j < m && mat[i * m + j].first == mat[i * m + cnt[i]].first) {
      if (++num[mat[i * m + j].second] == n) {
        ans.push_back(mat[i * m + j].second);
        for (int k = 0; k < n; k++)
          if (data[k * m + mat[i * m + j].second] != -1) {
            if (--w[k] == 0) que.push(k);
          }
      }
      j++;
    }
    cnt[i] = j;
  }
  if (ans.size() == m) {
    for (__typeof(ans.begin()) i = ans.begin(); i != ans.end(); i++)
      printf("%d ", *i + 1);
    puts("");
  } else
    printf("-1\n");
  return 0;
}
