#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; const ll MOD = 998244353; #include using namespace atcoder; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll h,w;cin>>h>>w; vector S(h); rep(i,h) cin>>S[i]; rep(i,h){ ll cnt=0; while(cnt