#include using namespace std; #define REP(i,n) for (int i = 0; i < (n); ++i) char arr[30][30]; int cnts[30]; int main() { int n; while (scanf("%d", &n) == 1) { REP(i, 26) cnts[i] = 0; REP(i, n) scanf("%s", arr[i]); REP(i, n) { REP(j, n) { ++cnts[arr[i][j] - 'A']; } } char missing=0; REP(i, 26) { if (cnts[i] == n-1) missing = i + 'A'; } REP(i, n) { REP(j, n) { bool ok = true; REP(k, n) { if (arr[i][k] == missing) ok = false; } REP(k, n) if (arr[k][j] == missing) ok = false; if (ok) { printf("%d %d %c\n", i + 1, j + 1, missing); } } } } return 0; }