#include using namespace std; #define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<int(a);) #define rep(i,n) repi(i,0,n) #define per(i,n) peri(i,0,n) #define all(c) begin(c),end(c) #define mp make_pair #define mt make_tuple using uint=unsigned; using ll=long long; using ull=unsigned long long; using vi=vector; using vvi=vector; using vl=vector; using vvl=vector; using vd=vector; using vvd=vector; using vs=vector; templatebool chmin(T& a,const U& b){return a>b?(a=b,1):0;} templatebool chmax(T& a,const U& b){return a void print_vars(ostream& os,const Car& car,const Cdr&... cdr){ print_vars(os< ostream& operator<<(ostream& os,const pair& p){ return os<<'('< void print_tuple(ostream&,const Tuple&){} template void print_tuple(ostream& os,const Tuple& t){ os<(t)<<(sizeof...(Cdr)?",":""); print_tuple(os,t); } template ostream& operator<<(ostream& os,const tuple& t){ print_tuple<0,Args...>(os<<'(',t); return os<<')'; } template basic_ostream& operator<<(basic_ostream& os,const C& c){ os<<'['; for(auto i=begin(c);i!=end(c);++i) os<<(i==begin(c)?"":" ")<<*i; return os<<']'; } constexpr int INF=1e9; constexpr int MOD=1e9+7; constexpr double EPS=1e-9; int solve_naive(vi a,int i) { queue> q; q.emplace(a,i,0); set> vis; while(q.size()){ auto [ca,ci,cc]=q.front(); q.pop(); if(count(all(ca),1)==0) return cc; if(!vis.emplace(ca,ci).second) continue; if(0>i&&i;){ i--; vi a; { string s; cin>>s; for(char c:s) a.push_back(c=='#'); } cout<