import sys readline=sys.stdin.readline N,K=map(int,readline().split()) H=(N+K-1)//K ans_lst=[["."]*H for h in range(H)] for i in range(H): for j in range(i,i+K): if N: ans_lst[i][j%H]="#" N-=1 for ans in ans_lst: print(*ans,sep="")