#include <bits/stdc++.h>
using namespace std;
int const MAXN = 301;
bool done[MAXN][MAXN];
int A[MAXN][MAXN], r, c;
int star(int x, int y) {
  if (A[x][y] == 0) return -1;
  if (x == 0 || y == 0 || x + 1 == r || y + 1 == c) return -1;
  if (!(A[x - 1][y] == 1 && A[x + 1][y] == 1 && A[x][y - 1] == 1 &&
        A[x][y + 1] == 1))
    return -1;
  done[x][y] = true;
  int sol = 0, yl = y - 1, yr = y + 1, xu = x - 1, xd = x + 1;
  while (yl >= 0 && yr < c && xu >= 0 && xd < r) {
    if (A[x][yl] == 1 && A[x][yr] == 1 && A[xu][y] == 1 && A[xd][y] == 1) {
      done[x][yl] = true, done[x][yr] = true, done[xu][y] = true,
      done[xd][y] = true;
      sol++;
      yl--, yr++, xu--, xd++;
    } else
      break;
  }
  return sol;
}
struct soluzione {
  int a, b, c;
};
soluzione bs(int x, int y, int z) {
  soluzione tmp;
  tmp.a = x;
  tmp.b = y;
  tmp.c = z;
  return tmp;
}
vector<soluzione> V;
int main() {
  cin >> r >> c;
  for (int i = 0; i < r; i++)
    for (int j = 0; j < c; j++) {
      char ch;
      cin >> ch;
      A[i][j] = (ch == '*') ? 1 : 0;
    }
  for (int i = 0; i < r; i++)
    for (int j = 0; j < c; j++)
      if (star(i, j) != -1) V.push_back(bs(i + 1, j + 1, star(i, j)));
  for (int i = 0; i < r; i++)
    for (int j = 0; j < c; j++)
      if (A[i][j] == 1 && done[i][j] == false) {
        cout << -1;
        return 0;
      }
  cout << V.size() << "\n";
  for (auto i : V) cout << i.a << " " << i.b << " " << i.c << "\n";
}
