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;
int used[111111 * 5];
vector<int> g[111111 * 5];
int deg[111111 * 5];
vector<pair<int, int> > edges;
vector<int> ans;
void dfs(int x) {
  used[x] = 1;
  for (auto p : g[x]) {
    if (used[p] == 1) {
      puts("-1");
      exit(0);
    }
    if (used[p] == 0) dfs(p);
  }
  used[x] = 2;
  ans.push_back(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]++;
        if (Set.size() != 1 && !last)
          g[V[t].second].push_back(pre + 1), deg[pre + 1]++;
      }
      if (Set.size() != 1) pre++;
      first = false;
    }
  }
  memset(used, 0, sizeof(used));
  for (int i = 0; i < pre; i++)
    if (used[i] == 0) dfs(i);
  reverse(ans.begin(), ans.end());
  vector<int> ans2;
  ans2.clear();
  for (int i = 0; i < ans.size(); i++)
    if (ans[i] < m) putint(ans[i] + 1), put(' ');
  return clear();
}