#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int H, W; cin >> H >> W; vector S(H); for (auto &s : S) cin >> s; vector> ans; for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { if (S[i][j] == '#') continue; // 横のカギ bool horizontal = (j == 0 || S[i][j - 1] == '#') && (j + 1 < W && S[i][j + 1] == '.'); // 縦のカギ bool vertical = (i == 0 || S[i - 1][j] == '#') && (i + 1 < H && S[i + 1][j] == '.'); if (horizontal || vertical) { ans.emplace_back(i + 1, j + 1); } } } cout << ans.size() << '\n'; for (auto [r, c] : ans) { cout << r << ' ' << c << '\n'; } return 0; }