#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n][n];
for( int i=0 ; i<n ; i++ )
{
for( int j=0 ; j<n ; j++ )
{
cin >> a[i][j];
}
}
for( int i=0 ; i<n ; i++ )
{
int min=a[i][0];
for( int j=0 ; i-j>=0 ; j++ ) // критерий отбора элементов под главной диагональю
{
if( a[i][j]<min )
{
min = a[i][j];
}
}
cout << min << (i+1!=n?' ':'\n');
}
}
I2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCWludCBuOwoJY2luID4+IG47CglpbnQgYVtuXVtuXTsKCWZvciggaW50IGk9MCA7IGk8biA7IGkrKyApCgl7CgkJZm9yKCBpbnQgaj0wIDsgajxuIDsgaisrICkKCQl7CgkJCWNpbiA+PiBhW2ldW2pdOwoJCX0KCX0KCWZvciggaW50IGk9MCA7IGk8biA7IGkrKyApCgl7CgkJaW50IG1pbj1hW2ldWzBdOwoJCWZvciggaW50IGo9MCA7IGktaj49MCA7IGorKyApICAgLy8g0LrRgNC40YLQtdGA0LjQuSDQvtGC0LHQvtGA0LAg0Y3Qu9C10LzQtdC90YLQvtCyINC/0L7QtCDQs9C70LDQstC90L7QuSDQtNC40LDQs9C+0L3QsNC70YzRjgoJCXsKCQkJaWYoIGFbaV1bal08bWluICkKCQkJewoJCQkJbWluID0gYVtpXVtqXTsKCQkJfQoJCX0KCQljb3V0IDw8IG1pbiA8PCAoaSsxIT1uPycgJzonXG4nKTsKCX0KfQ==