#include #include #include #include #include #include #include using namespace std; int main () { int clubs; while(scanf("%d", &clubs) > 0) { char tribune[26][26]; int rows[26]; int columns[26]; for(int i = 0; i < clubs; i++) { rows[i] = columns[i] = 0; } for(int i = 0; i < clubs; i++) { char c; for(int j = 0; j < clubs; j++) { scanf(" %c", &c); tribune[i][j] = c; } } for(int i = 0; i < clubs; i++) { for(int j = 0; j < clubs; j++) { rows[i] = rows[i] + tribune[i][j] -'A'; columns[j] = columns[j] + tribune[i][j] -'A'; } } int right = 0; int wrong = 0; int wrow = 0; int wcol = 0; right = rows[0]; if(rows[1] != right) { if(rows[1] == rows[2]) right = rows[2]; } for(int i = 0; i < clubs; i++) { if(rows[i] != right) { wrow = i; wrong = rows[i]; break; } } for(int i = 0; i < clubs; i++) { if(columns[i] != right) { wcol = i; break; } } char r = 'A' + abs(right - (wrong - (tribune[wrow][wcol] - 'A'))); printf("%d %d %c\n", wrow+1, wcol+1, r); } return 0; }