func_code_string: #include <bits/stdc++.h>   using namespace std;   bool done[123][123];   char s[123][123];   vector<pair<pair<long long, long long>, long long int> > v;   int main() {     long long int n, m;     scanf( %lld%lld , &n, &m);     for (int i = 0; i < n; ++i)       for (int j = 0; j < m; ++j) {         done[i][j] = false;         scanf(  %c , &s[i][j]);       }     for (int i = 1; i < n - 1; ++i)       for (int j = 1; j < m - 1; ++j)         if (s[i][j] !=  . ) {           if (s[i - 1][j] ==  *  && s[i + 1][j] ==  *  && s[i][j - 1] ==  *  &&               s[i][j + 1] ==  * ) {             long long int up = 0, dn = 0, lt = 0, rt = 0;             for (int k = i - 1; k >= 0; k--)               if (s[k][j] ==  . )                 break;               else                 up++;             for (int k = i + 1; k < n; k++)               if (s[k][j] ==  . )                 break;               else                 dn++;             for (int k = j - 1; k >= 0; k--)               if (s[i][k] ==  . )                 break;               else                 lt++;             for (int k = j + 1; k < m; k++)               if (s[i][k] ==  . )                 break;               else                 rt++;             long long int mn = min(up, min(dn, min(lt, rt)));             if (mn) {               v.push_back(                   make_pair(pair<long long, long long>(i + 1, j + 1), mn));               int k, cnt;               cnt = mn;               done[i][j] = true;               for (k = i - 1; cnt; k--, cnt--) done[k][j] = true;               cnt = mn;               for (k = i + 1; cnt; k++, cnt--) done[k][j] = true;               cnt = mn;               for (k = j - 1; cnt; k--, cnt--) done[i][k] = true;               cnt = mn;               for (k = j + 1; cnt; k++, cnt--) done[i][k] = true;             }           }         }     for (int i = 0; i < n; ++i)       for (int j = 0; j < m; ++j)         if (s[i][j] ==  *  && done[i][j] == false) {           printf( -1 n );           return 0;         }     printf( %lld n , (long long int)v.size());     for (int i = 0; i != (long long int)v.size(); ++i)       printf( %lld %lld %lld n , v[i].first.first, v[i].first.second,              v[i].second);     return 0;   }   