#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const long long int inf = 1e12;
const long long int N = 1e5 + 5;
const long long int level = 31;
long long int solve(long long int u) {
  long long int n, m;
  cin >> n >> m;
  char arr[n][m];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      cin >> arr[i][j];
    }
  }
  char brr[n][m];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      brr[i][j] = '.';
    }
  }
  long long int ans = 0;
  vector<pair<pair<long long int, long long int>, long long int>> v;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (arr[i][j] == '*') {
        long long int a = 1;
        long long int h = 0;
        while (i - a >= 0 && i + a < n && j - a >= 0 && j + a < m) {
          if (arr[i - a][j] == '*' && arr[i + a][j] == '*' &&
              arr[i][j + a] == '*' && arr[i][j - a] == '*') {
            brr[i - a][j] = '*';
            brr[i + a][j] = '*';
            brr[i][j - a] = '*';
            brr[i][j + a] = '*';
            h++;
            a++;
          } else {
            break;
          }
        }
        if (h > 0) {
          ans++;
          brr[i][j] = '*';
          v.push_back({{i, j}, h});
        }
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (arr[i][j] != brr[i][j]) {
        cout << -1;
        return 0;
      }
    }
  }
  cout << ans << endl;
  for (auto j : v) {
    cout << j.first.first + 1 << " " << j.first.second + 1 << " " << j.second
         << '\n';
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  for (long long int i = 1; i <= t; i++) {
    solve(i);
  }
  return 0;
}
