#include <iostream>
using namespace std;
const int n = 8 ;
int main( ) {
double a[ n] [ n] ; int q,p;
for ( int i= 0 ; i< n; i++ ) {
for ( int j= 0 ; j< n; j++ ) {
cin >> a[ i] [ j] ;
if ( a[ i] [ j] == 1 ) { q= i; p= j; }
}
}
for ( int i= q; i>= 0 ; i-- ) {
if ( a[ i] [ p] == 2 ) { cout << "Копроль под угрозой от ферзя (" << i+ 1 << "," << p+ 1 << ")\n " ; break ; } }
for ( int i= q; i< n; i++ ) {
if ( a[ i] [ p] == 2 ) { cout << "Копроль под угрозой от ферзя (" << i+ 1 << "," << p+ 1 << ")\n " ; break ; } }
for ( int j= p; j>= 0 ; j-- ) {
if ( a[ q] [ j] == 2 ) { cout << "Копроль под угрозой от ферзя (" << q+ 1 << "," << j+ 1 << ")\n " ; break ; } }
for ( int j= p; j< n; j++ ) {
if ( a[ q] [ j] == 2 ) { cout << "Копроль под угрозой от ферзя (" << q+ 1 << "," << j+ 1 << ")\n " ; break ; } }
for ( int i= q,j= p; ( i>= 0 && j>= 0 ) ; ( i-- && j-- ) ) {
if ( a[ i] [ j] == 2 ) { cout << "Копроль под угрозой от ферзя (" << i+ 1 << "," << j+ 1 << ")\n " ; break ; } }
for ( int i= q,j= p; ( i< n && j< n) ; ( i++ && j++ ) ) {
if ( a[ i] [ j] == 2 ) { cout << "Копроль под угрозой от ферзя (" << i+ 1 << "," << j+ 1 << ")\n " ; break ; } }
for ( int i= q,j= p; ( i>= 0 && j< n) ; ( i-- && j++ ) ) {
if ( a[ i] [ j] == 2 ) { cout << "Копроль под угрозой от ферзя (" << i+ 1 << "," << j+ 1 << ")\n " ; break ; } }
for ( int i= q,j= p; ( i< n && j>= 0 ) ; ( i++ && j-- ) ) {
if ( a[ i] [ j] == 2 ) { cout << "Копроль под угрозой от ферзя (" << i+ 1 << "," << j+ 1 << ")\n " ; break ; } }
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBpbn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 0 0 0
0 0 0 0 0 0 0 0
stdout
Копроль под угрозой от ферзя (4,4)
Копроль под угрозой от ферзя (6,4)
Копроль под угрозой от ферзя (5,3)
Копроль под угрозой от ферзя (5,5)
Копроль под угрозой от ферзя (4,3)
Копроль под угрозой от ферзя (6,5)
Копроль под угрозой от ферзя (4,5)
Копроль под угрозой от ферзя (6,3)