#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int,int>;
void solve() {
int n;
cin >> n;
int grid[n+1][n+1];
for(int i=1; i<=n; ++i) for(int j=i; j<=n; ++j) cin >> grid[i][j];
vector<pi> lengths;
int cnt = 0;
for(int i=1; i<=n; ++i) {
int j = i;
while(j+1<n && grid[j][j+1] == 2) ++j;
lengths.push_back({i,j});
i = j;
}
vi type(lengths.size(), -1);
type[0] = 0;
for(int i=2; i<lengths.size(); ++i) {
int l1 = lengths[i].first, r2 = lengths[i-2].second, l2 = lengths[i-2].first;
if(grid[l2][l1] > (r2-l2+1)) type[i] = type[i-2];
else {
for(int j=0; j<3; ++j) {
if(j != type[i-1] && j != type[i-2]) type[i] = j;
}
}
}
vi len(3, 0);
for(int i=0; i<lengths.size(); ++i) {
len[type[i]] += lengths[i].second - lengths[i].first + 1;
}
int ans = 0;
if(len[1] > max(len[2], len[0])) ans = 1;
else if(len[2] > max(len[1], len[0])) ans = 2;
for(int i=0; i<lengths.size(); ++i) {
if(type[i] != ans) continue;
for(int j=lengths[i].first; j<=lengths[i].second; ++j) cout << j << " ";
}
cout << endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int tc = 1;
while(tc--) solve();
return 0;
}