from functools import lru_cache import sys input = sys.stdin.readline N = int(input()) M = 2000 grid = [[1] * M for _ in range(M)] grid[0][0]=0 def f(N, i, j): if N == 1: return i, j h = N//2 w = N-h for k in range(h+1): for l in range(w+1): grid[i+k][j+l] = 0 i += h j += w i, j = f(h, i, j) i, j = f(w, i, j) return i, j i, j = f(N, 0, 0) H = i + 1 W = j + 1 print(H, W) for row in grid[:H]: print("".join(map(lambda x: ".#"[x], row[:W])))