func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n;     string s[1000];     scanf( %d , &n);     for (int i = 0; i < n; i++) {       cin >> s[i];     }     char ch = s[0][0];     int flg = 0, cnc = 0, cnch = 0;     char c = s[0][1];     if (c == ch) flg = 1;     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         if (s[i][j] == c) {           cnc++;         } else if (s[i][j] == ch) {           cnch++;         } else           flg = 1;       }     }     if (cnch != 2 * n - 1)       flg = 1;     else if (n * n - cnch != cnc)       flg = 1;     for (int j = 0, i = 0; i < n / 2; i++) {       if (s[i][i] == s[i][n - i - 1] && ch == s[i][i]) {       } else         flg = 1;     }     if (s[n / 2][n / 2] != ch) flg = 1;     for (int j = 0, i = n - 1; i > n / 2; j++, i--) {       if (s[i][j] == s[i][n - 1 - j] && ch == s[i][j]) {       } else         flg = 1;     }     if (flg)       cout <<  NO  << endl;     else       cout <<  YES  << endl;   }   