#include <bits/stdc++.h>
using namespace std;
char g[105][105], g2[105][105];
int top[105][105], bottom[105][105], right1[105][105], left1[105][105];
struct node {
  int x;
  int y;
  int s;
};
bool flag(int a, int b, int c, int d) {
  if (a == b && b == c && c == d) return true;
  return false;
}
int main() {
  int m, n;
  while (cin >> n >> m) {
    for (int i = 0; i <= n + 1; i++)
      for (int j = 0; j <= m + 1; j++) g2[i][j] = g[i][j] = '.';
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) cin >> g[i][j];
    memset(bottom, 0, sizeof(bottom));
    memset(top, 0, sizeof(top));
    memset(right1, 0, sizeof(right1));
    memset(left1, 0, sizeof(left1));
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++)
        if (g[i][j] == '*') {
          left1[i][j] = left1[i][j - 1] + 1;
          top[i][j] = top[i - 1][j] + 1;
        }
    }
    for (int i = n; i >= 1; i--)
      for (int j = m; j >= 1; j--) {
        if (g[i][j] == '*') {
          right1[i][j] = right1[i][j + 1] + 1;
          bottom[i][j] = bottom[i + 1][j] + 1;
        }
      }
    vector<node> ans;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) {
        if (g[i][j] != '*') continue;
        int s1 = min(min(left1[i][j - 1], right1[i][j + 1]),
                     min(top[i - 1][j], bottom[i + 1][j]));
        if (s1 != 0) {
          node temp = {i, j, s1};
          ans.push_back(temp);
        }
      }
    bool flag = true;
    for (int i = 0; i < ans.size(); i++) {
      int x = ans[i].x, y = ans[i].y;
      g2[ans[i].x][ans[i].y] = '*';
      for (int j = 1; j <= ans[i].s; j++) {
        g2[x + j][y] = '*';
        g2[x][y + j] = '*';
        g2[x - j][y] = '*';
        g2[x][y - j] = '*';
      }
    }
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) {
        if (g2[i][j] != g[i][j]) {
          flag = false;
          break;
        }
      }
    if (!flag) {
      cout << "-1" << endl;
      continue;
    }
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++)
      cout << ans[i].x << ' ' << ans[i].y << ' ' << ans[i].s << endl;
  }
}
