n,k = map(int,input().split()) m = (n+k-1)//k while m*m < n: m += 1 r = [[0]*m for _ in range(m)] cnt = 0 def f(x): return ".#"[x] for i in range(m): for j in range(min(m,k)): r[i][(i+j)%m] = 1 cnt += 1 if cnt == n: for ri in r: print("".join(map(f,ri))) exit()