Problem: Lenny had an n × m matrix of positive integers. He loved the matrix so much, because each row of the matrix was sorted in non-decreasing order. For the same reason he calls such matrices of integers lovely.

One day when Lenny was at school his little brother was playing with Lenny's matrix in his room. He erased some of the entries of the matrix and changed the order of some of its columns. When Lenny got back home he was very upset. Now Lenny wants to recover his matrix.

Help him to find an order for the columns of the matrix so that it's possible to fill in the erased entries of the matrix to achieve a lovely matrix again. Note, that you can fill the erased entries of the matrix with any integers.

Input

The first line of the input contains two positive integers n and m (1 ≤ n·m ≤ 105). Each of the next n lines contains m space-separated integers representing the matrix. An integer -1 shows an erased entry of the matrix. All other integers (each of them is between 0 and 109 inclusive) represent filled entries.

Output

If there exists no possible reordering of the columns print -1. Otherwise the output should contain m integers p1, p2, ..., pm showing the sought permutation of columns. So, the first column of the lovely matrix will be p1-th column of the initial matrix, the second column of the lovely matrix will be p2-th column of the initial matrix and so on.

Examples

Input

3 3
1 -1 -1
1 2 1
2 -1 1


Output

3 1 2 


Input

2 3
1 2 2
2 5 4


Output

1 3 2 


Input

2 3
1 2 3
3 2 1


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16000000")
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inf2 = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
namespace fastio {
char in[100000];
int itr = 0, llen = 0;
char get() {
  if (itr == llen) llen = fread(in, 1, 100000, stdin), itr = 0;
  if (llen == 0) return EOF;
  return in[itr++];
}
char out[100000];
int itr2 = 0;
void put(char c) {
  out[itr2++] = c;
  if (itr2 == 100000) {
    fwrite(out, 1, 100000, stdout);
    itr2 = 0;
  }
}
int clear() {
  fwrite(out, 1, itr2, stdout);
  itr2 = 0;
  return 0;
}
int getint() {
  int r = 0;
  bool ng = 0;
  char c;
  c = get();
  while (c != '-' && (c < '0' || c > '9')) c = get();
  if (c == '-') ng = 1, c = get();
  while (c >= '0' && c <= '9') r = r * 10 + c - '0', c = get();
  return ng ? inf : r;
}
string getstr() {
  string ret = "";
  char ch = get();
  while (ch == ' ' || ch == '\n') ch = get();
  while (ch != ' ' && ch != '\n') ret.push_back(ch), ch = get();
  return ret;
}
void putstr(string s) {
  for (int i = 0; i < s.size(); i++) put(s[i]);
}
void putint(int x) {
  if (x == 0) {
    put('0');
    return;
  }
  char c[20];
  int pos = 0;
  while (x) {
    c[pos++] = '0' + x % 10;
    x /= 10;
  }
  for (int i = pos - 1; i >= 0; i--) put(c[i]);
}
void getarr(int arrname[], int size) {
  for (int i = 0; i < size; i++) arrname[i] = getint();
}
}  // namespace fastio
using namespace fastio;
int n, m;
bool used[111111 * 5];
vector<int> g[111111 * 5];
int deg[111111 * 5];
vector<pair<int, int> > edges;
vector<int> ans;
void dfs(int x, int par) {
  used[x] = true;
  ans.push_back(x);
  for (auto p : g[x]) {
    deg[p]--;
    if (deg[p] == 0) dfs(p, x);
  }
}
int main() {
  n = getint();
  m = getint();
  vector<vector<int> > vec(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) vec[i][j] = getint();
  int pre = m;
  for (int i = 0; i < n; i++) {
    bool buff = (i == 0);
    vector<pair<int, int> > V;
    for (int j = 0; j < m; j++) V.push_back(make_pair(vec[i][j], j));
    sort(V.begin(), V.end());
    while (V.back().first == inf) V.pop_back();
    if (!V.size()) continue;
    int pos = 0;
    set<int> Set;
    Set.clear();
    for (int ii = 0; ii < V.size(); ii++) {
      Set.insert(V[ii].first);
    }
    bool first = true;
    for (set<int>::iterator itr = Set.begin(); itr != Set.end(); itr++) {
      int p = *itr;
      set<int>::iterator itr2 = itr;
      itr2++;
      bool last = itr2 == Set.end();
      for (int &t = pos; t < V.size() && V[t].first == p; t++) {
        if (!first)
          g[pre].push_back(V[t].second), deg[V[t].second]++,
              cerr << V[t].second << endl;
        if (Set.size() != 1 && !last)
          g[V[t].second].push_back(pre + 1), deg[pre + 1]++,
              cerr << pre << endl;
      }
      if (Set.size() != 1) pre++;
      first = false;
    }
  }
  cerr << "Start top sort:\n";
  for (int i = 0; i < pre; i++)
    if (!used[i] && !deg[i]) dfs(i, -1);
  vector<int> ans2;
  ans2.clear();
  set<int> Set;
  for (int i = 0; i < ans.size(); i++)
    if (ans[i] < m) ans2.push_back(ans[i]), Set.insert(ans[i]);
  for (int i = 0; i < m; i++) {
    bool ng = true;
    for (int j = 0; j < n; j++)
      if (vec[j][i] != inf) ng = false;
    if (ng && Set.count(i) == 0) ans2.push_back(i);
  }
  if (ans2.size() < m) {
    puts("-1");
    return 0;
  } else {
    for (int i = 0; i < ans2.size(); i++) putint(ans2[i] + 1), put(' ');
    return clear();
  }
  return 0;
}