#include <bits/stdc++.h>
using namespace std;
queue<int> q;
vector<int> G[300010];
int ind[300010], per[300010], pn;
struct node {
  int v, i;
} a[300010];
bool comp(node x, node y) { return x.v < y.v; }
int main() {
  int n, m, k = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) scanf("%d", &a[j].v), a[j].i = j;
    sort(a, a + m, comp);
    for (int j = 0; j < m; j++)
      if (a[j].v != -1) {
        if (j == 0 || a[j].v != a[j - 1].v) k++;
        G[a[j].i].push_back(m + k + 1);
        G[m + k].push_back(a[j].i);
      }
    k++;
  }
  for (int i = 0; i < m + k; i++)
    for (__typeof((G[i]).begin()) it = (G[i]).begin(); it != (G[i]).end(); it++)
      ind[*it]++;
  for (int i = 0; i < m + k; i++)
    if (ind[i] == 0) q.push(i);
  while (!q.empty()) {
    int p = q.front();
    q.pop();
    if (p < m) per[pn++] = p;
    for (__typeof((G[p]).begin()) it = (G[p]).begin(); it != (G[p]).end(); it++)
      if (--ind[*it] == 0) q.push(*it);
  }
  if (pn < m) return puts("-1"), 0;
  for (int i = 0; i < m; i++) printf("%d ", per[i] + 1);
}
