H, W = map(int, input().split()) S = [input() for _ in range(H)] ans = [] for h in range(H): for w in range(W): if S[h][w] != ".": continue vertical = (h == 0 or S[h-1][w] == "#") and h != H-1 and S[h+1][w] == "." horizontal = (w == 0 or S[h][w-1] == "#") and w != W-1 and S[h][w+1] == "." if vertical or horizontal: ans.append((h, w)) print(len(ans)) for h, w in ans: print(h, w)