R=range H,W,K,M=map(int,input().split()) HW=H*W p=1<>d)&1for d in R(HW)) count[c]+=1<<(HW-c-sum((bs>>d)&1for d in R(HW))) for i in R(HW): if(bs>>i)&1<1:continue h,w=i//W,i%W t=s|(1<>t)&1:continue; found|=(1<>j)&1<1:bt|=(1<