#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  char ch[n][m];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> ch[i][j];
  pair<pair<int, int>, pair<int, int>> a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i != 0 && i != n - 1 && j != 0 && j != m - 1 && ch[i][j] == '*' &&
          ch[i - 1][j] == '*' && ch[i + 1][j] == '*' && ch[i][j - 1] == '*' &&
          ch[i][j + 1] == '*') {
        a[i][j].first = make_pair(0, 0);
        a[i][j].second = make_pair(0, 0);
        for (int k = i; k >= 0; k--) {
          if (ch[k][j] == '*') {
            a[i][j].first.first++;
          } else
            break;
        }
        for (int k = i; k < n; k++) {
          if (ch[k][j] == '*') {
            a[i][j].first.second++;
          } else
            break;
        }
        for (int k = j; k >= 0; k--) {
          if (ch[i][k] == '*') {
            a[i][j].second.first++;
          } else
            break;
        }
        for (int k = j; k < m; k++) {
          if (ch[i][k] == '*') {
            a[i][j].second.second++;
          } else
            break;
        }
      } else {
        a[i][j].first = make_pair(0, 0);
        a[i][j].second = make_pair(0, 0);
      }
    }
  }
  vector<pair<pair<int, int>, int>> v;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int x = min(min(a[i][j].first.first, a[i][j].first.second),
                  min(a[i][j].second.first, a[i][j].second.second));
      if (x != 0) {
        v.push_back(make_pair(make_pair(i, j), x));
        int c = 0;
        while (x--) {
          ch[i + c][j] = '.';
          ch[i - c][j] = '.';
          ch[i][j + c] = '.';
          ch[i][j - c] = '.';
          c++;
        }
      }
    }
  }
  int first = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (ch[i][j] == '*') {
        first = 1;
        break;
      }
  cout << "\n";
  if (first == 1)
    cout << -1;
  else {
    cout << v.size() << "\n";
    for (int i = 0; i < v.size(); i++) {
      cout << v[i].first.first + 1 << " " << v[i].first.second + 1 << " "
           << v[i].second - 1 << "\n";
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
