#include <iostream>
using namespace std;
int
n, stud[21][21], allocate[21], bookalloced[21];
void
__read__()
{
cin >> n;
for( int i = 1; i <= n; i++ )
for( int j = 1; j <= n; j++ )
cin >> stud[i][j];
}
void
__outp__()
{
for( int i = 1; i < n; i++ )
cout << allocate[i] << " ";
cout << allocate[n] << endl;
}
void
__dfs__( int x )
{
if( x <= n )
{
for( int i = 1; i <= n; i++ )
if( stud[x][i] && !bookalloced[i] )
{
allocate[x] = i;
bookalloced[i] = true;
__dfs__( x + 1 );
bookalloced[i] = false;
}
}
else if( x > n )
{
__outp__();
return;
}
}
int
main()
{
__read__();
__dfs__( 1 );
return 0;
}