import math n, k = map(int, input().split(' ')) if n <= k**2: k = math.ceil(n**0.5) l = math.ceil(n/k) mod = n % k grid = [('*' *k) + ('.' *(l-k)) for i in range(n//k)] if mod: grid.append(('*'*mod) + ('.'*(l-mod))) for i in range(1, len(grid)): grid[i] = grid[i][i:] + grid[i][:i] print(l) for row in grid: print(row)