N,K=map(int,input().split()) ANS=(N+(K-1))//K while ANS*ANS0: MAP[i][(i+j)%ANS]="#" now-=1 for map in MAP: print("".join(map))