/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); int n,maxa,mina;
n = in.nextInt();
int a[][]=new int[n][n];
for(int i=0; i<n;++i){
for(int j=0;j<n;++j){
a[i][j] = in.nextInt();
}
}
int b[] =new int[n];
for(int i=0;i<n;++i){
maxa=a[i][0]; //Придаем максимуму значение первого элемента i-й строки.
mina=a[0][i]; //Минимуму же придаем значение первого элемента i-го столбца.
for(int j=0;j<n;++j){
maxa=(maxa>a[i][j]?maxa:a[i][j]); //Вычисляем максимум i-й строки.
mina=(mina<a[j][i]?mina:a[j][i]); //Минимум i-го столбца.
}
b[i]=maxa*mina; //Наш результат.
}
for(int i=0;i<n;++i){
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCQlpbnQgbixtYXhhLG1pbmE7CgkJCW4gPSBpbi5uZXh0SW50KCk7CgkJCWludCBhW11bXT1uZXcgaW50W25dW25dOwoJCWZvcihpbnQgaT0wOyBpPG47KytpKXsKCQkJZm9yKGludCBqPTA7ajxuOysrail7CgkJCQlhW2ldW2pdID0gaW4ubmV4dEludCgpOwoJCX0KCX0KCWludCBiW10gPW5ldyBpbnRbbl07Cglm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