#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int> > p[100100];
vector<int> p1[100100];
int in[100100];
int cnt[100100];
int rep[100100];
bool vis[100100];
int st[100100], stn;
int res[100100];
void ch(int i) {
  if (cnt[i]) return;
  if (in[i] == m) return;
  int val = p[i][in[i]].first;
  for (; in[i] < m; in[i]++) {
    int j = in[i];
    if (val != p[i][in[i]].first) break;
    cnt[i]++;
    rep[p[i][j].second]++;
    if (rep[p[i][j].second] == n) {
      st[stn++] = p[i][j].second;
    }
  }
}
int main() {
  cin >> n >> m;
  int x;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &x);
      p[i].push_back({x, j});
      p1[i].push_back(x);
    }
    sort(p[i].begin(), p[i].end());
  }
  for (int i = 0; i < n; i++) {
    for (; in[i] < m; in[i]++) {
      int j = in[i];
      if (p[i][j].first != -1) break;
      rep[p[i][j].second]++;
      if (rep[p[i][j].second] == n) {
        st[stn++] = p[i][j].second;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    int val = -1;
    if (in[i] < m) val = p[i][in[i]].first;
    for (; in[i] < m; in[i]++) {
      int j = in[i];
      if (p[i][j].first != val) break;
      rep[p[i][j].second]++;
      cnt[i]++;
      if (rep[p[i][j].second] == n) {
        st[stn++] = p[i][j].second;
      }
    }
  }
  for (int k = 0; k < m; k++) {
    if (stn == 0) {
      cout << -1;
      return 0;
    }
    int col = st[--stn];
    res[k] = col;
    vis[col] = 1;
    for (int i = 0; i < n; i++) {
      if (p1[i][col] == -1) continue;
      cnt[i]--;
      ch(i);
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d ", res[i] + 1);
  }
  return 0;
}
