N = int(input()) H = W = 2000 S = [list('#'*W) for _ in range(H)] stack = [N] x = y = 0 while stack: n = stack.pop() n1 = n // 2 n2 = n - n1 for i in range(x, x+n1+1): for j in range(y, y+n2+1): S[i][j] = '.' x += n1 y += n2 if n1 > 1: stack.append(n1) if n2 > 1: stack.append(n2) for i in range(x, H): S[i][y] = '.' for i in range(y, W): S[-1][i] = '.' print(H, W) for s in S: print(''.join(s))