#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, m, l, la;
  scanf("%d %d", &n, &m);
  vector<string> grid(n);
  for (i = 0; i < n; i++) cin >> grid[i];
  vector<vector<bool> > covered(n, vector<bool>(m, false));
  vector<int> r, c, sl;
  for (i = 1; i < n - 1; i++) {
    for (j = 1; j < m - 1; j++) {
      if (grid[i][j] != '*') continue;
      if (grid[i + 1][j] == '*' && grid[i - 1][j] == '*' &&
          grid[i][j + 1] == '*' && grid[i][j - 1] == '*')
        covered[i][j] = true;
      else
        continue;
      l = 1;
      la = 1;
      while (true) {
        if (i + l >= n || i - l < 0 || j - l < 0 || j + l >= m) break;
        if (grid[i + l][j] == '*' && grid[i - l][j] == '*' &&
            grid[i][j + l] == '*' && grid[i][j - l] == '*') {
          covered[i + l][j] = covered[i - l][j] = covered[i][j + l] =
              covered[i][j - l] = true;
          la = l;
          l += 1;
        } else
          break;
      }
      r.push_back(i + 1);
      c.push_back(j + 1);
      sl.push_back(la);
    }
  }
  bool all_covered = true;
  for (i = 0; all_covered && i < n; i++) {
    for (j = 0; all_covered && j < m; j++) {
      if (grid[i][j] == '*' && covered[i][j] == false) all_covered = false;
    }
  }
  if (all_covered) {
    printf("%d\n", int(r.size()));
    for (i = 0; i < r.size(); i++) printf("%d %d %d\n", r[i], c[i], sl[i]);
  } else {
    printf("-1\n");
  }
  return 0;
}
