#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>i)&1) res|=!dfs(b^(1<>i)&1) continue; if((b>>(i-1))&1) continue; res|=!dfs(b^(1<(b)<<":"<>h>>w; vector st(h); for(Int i=0;i>st[i]; Int cnt[2]={}; for(Int i=0;i