#include using namespace std; using ll=long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int H,W,K; cin>>H>>W>>K; set>>se; auto search=[&](auto search,vector>V,int nx,int ny)->void{ if(ny==W){ nx++; ny=0; } if(nx==H){ bool ok=true; setcl; for(int i=0;i(W)); for(int k=0;k(W)); search(search,V,0,0); cout<