#include using namespace std; #define int long long using ll=long long; using vi=vector; using vl=vector; using pii=pair; using pll=pair; #define ITR(i,c) for(auto i=begin(c);i!=end(c);++i) #define FORE(x,c) for(auto &x:c) #define FOR(i,a,n) for(int i=a,i##_len=(int)n;i=0;--i) #define ALL(c) begin(c),end(c) #define RALL(c) rbegin(c),rend(c) #define SZ(c) ((int)c.size()) #define dump(...) const int DX[9]={0,1,0,-1,1,1,-1,-1,0}, DY[9]={-1,0,1,0,-1,1,1,-1,0}; const int INF=1e9*2; const long long INFLL=1e18*2; template ostream& operator << (ostream &os, const vector &v) { ITR(i,v) os << *i << (i==end(v)-1 ? "" : "\n"); return os; } template istream& operator >> (istream &is, vector &v) { ITR(i,v) is >> * i; return is; } template istream& operator >> (istream &is, pair &p) { is >> p.second >> p.first; return is; } templatebool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b create_pack(vi &a) { vector ret(3,"..."); REP(i,3) { int c=a[i]; REP(j,c) { ret[2-j][i]='#'; } } return ret; } signed main() { int H,W,N; cin>>H>>W>>N; vector S(H); vector C(N); cin>>S>>C; vi sum(W,0),pack(W,0),div(W,0); REP(j,W) { REP(i,H) { sum[j]+=(S[i][j]=='#'); } } FORE(c,C) { REP(i,3) { pack[c+i]++; } } REP(i,W) { div[i]=sum[i]/pack[i]; } // i番目のパックは左からans[i][0],ans[i][1],ans[i][2]個 (個数の合計がans[i][3]) vector> ans(N,vi(4,0)); REP(i,N) { int c=C[i]; REP(j,3) { if(div[c+j]==0) continue; if(sum[c+j]0) { ans[i][j]++; ans[i][3]++; sum[c+j]--; break; } } if(ans[i][3]==0) { cout<<"ERROR!"< p=create_pack(ans[i]); cout<