#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = (res % 998244353) * (x % 998244353);
      res %= 998244353;
    }
    y = y >> 1;
    x = (x % 998244353) * (x % 998244353);
    x %= 998244353;
  }
  return res % 998244353;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  char v[n][m];
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < m; j++) cin >> v[i][j];
  long long int dp[n][m];
  memset(dp, 0, sizeof(dp));
  vector<array<long long int, 3>> ans;
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < m; j++)
      if (v[i][j] == '*') {
        long long int len = 1;
        while (i - len >= 0 and i + len < n and j - len >= 0 and j + len < m and
               v[i][j - len] == '*' and v[i][j + len] == '*' and
               v[i - len][j] == '*' and v[i + len][j] == '*') {
          dp[i][j] = dp[i + len][j] = dp[i][j + len] = dp[i - len][j] =
              dp[i][j - len] = 1;
          len++;
        }
        if (len > 1) ans.push_back({i + 1, j + 1, len - 1});
      }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (dp[i][j] == 0 and v[i][j] == '*') {
        cout << "-1";
        return;
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it[0] << " " << it[1] << " " << it[2] << "\n";
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1;
  for (long long int i = 1; i <= T; i++) {
    solve();
  }
  return 0;
}
