include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
struct annode {
int x , y , val;
};
void Check ( std::vector < std::vector[HTML_REMOVED]>arr , int n , int m ) {
std::vector [HTML_REMOVED] res;
for (int i = 0 ; i < n ; i ) {
for ( int j = 0 ; j < m ; j ) {
// 检查行
int flag = 0 ;
int max_val = -1;
for ( int k = 0 ; k < m ; k ) {
max_val = std::max ( arr[i][k] , max_val );
}
flag = (arr[i][j] == max_val ) ? 1 : 0;
if ( !flag ) { continue;}
int min_val = 10;
// 检车咧
for ( int k = 0 ; k < n ; k ) {
min_val = std::min ( arr[k][j] , min_val );
}
flag = ( arr[i][j] == min_val ) ? 2 : 1;
if ( flag == 1 ) {
continue;
}
res.push_back({i+1 , j+1 , arr[i][j]});
}
}
if ( res.size() == 0 ) {
std::cout << "NO";
}
for ( int i = 0 ; i < res.size() ; i ++ ) {
std::cout << res[i].x << " " << res[i].y << " " << res[i].val << std::endl;
}
}
int n , m;
int main ()
{
std::cin >> n >> m;
std::vector< std::vector<int>>arr(n, std::vector<int> (m, 0));
/*
std::vector<int>arr (n);
for ( int i = 0 ; i < n ; i ++ ) {
arr[i].resize (m);
}
*/
for ( int i = 0 ; i < n ; i ++ ) {
for ( int j = 0 ; j < m ; j ++ ) {
std::cin >> arr[i][j];
}
}
Check (arr , n , m);
/*
for ( auto i : arr ) {
for ( auto j : i ) {
std::cout << j << " ";
}
std::cout << std::endl;
}
*/
system("pause");
return 0;
}