#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200005];
int N, n, m, deg[200005];
std::pair<int, int> mat[100005];
vector<vector<int> > SameN;
vector<int> ans;
bool Tsort() {
  queue<int> que;
  for (int i = 0; i < (N); i++)
    for (int j = 0; j < (adj[i].size()); j++) deg[adj[i][j]]++;
  for (int i = 0; i < (m); i++)
    if (deg[i] == 0) que.push(i);
  while (!que.empty()) {
    int out = que.front();
    que.pop();
    N--;
    if (out < m) ans.push_back(out);
    for (int i = 0; i < (adj[out].size()); i++) {
      int v = adj[out][i];
      deg[v]--;
      if (deg[v] == 0) que.push(v);
    }
  }
  return N == 0;
}
int main() {
  scanf("%d%d", &n, &m);
  N = m;
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (m); j++) {
      scanf("%d", &mat[j].first);
      mat[j].second = j;
    }
    sort(mat, mat + m);
    int fpos = 0;
    while (fpos < m && mat[fpos].first == -1) fpos++;
    if (fpos == m) continue;
    vector<int> vec;
    vec.push_back(mat[fpos].second);
    SameN.clear();
    for (int j = fpos + 1; j < m; j++)
      if (mat[j].first == mat[j - 1].first)
        vec.push_back(mat[j].second);
      else {
        SameN.push_back(vec);
        vec.clear();
        vec.push_back(mat[j].second);
      }
    SameN.push_back(vec);
    for (int j = SameN.size() - 2; j >= 0; j--) {
      vector<int> &vec1 = SameN[j];
      vector<int> &vec2 = SameN[j + 1];
      for (int k = 0; k < (vec1.size()); k++) adj[vec1[k]].push_back(N);
      for (int k = 0; k < (vec2.size()); k++) adj[N].push_back(vec2[k]);
      N++;
    }
  }
  if (Tsort()) {
    for (int k = 0; k < (ans.size()); k++) printf("%d ", ans[k] + 1);
  } else
    printf("-1");
  return 0;
}
