n = int(input()) l = [] st = [n] h, w = 1, 1 while st: p = st.pop() if p == 1: continue st.append(p // 2) st.append((p + 1) // 2) if h < w: l.append((p // 2, (p + 1) // 2)) h += p // 2 + 1 w += (p + 1) // 2 + 1 else: l.append(((p + 1) // 2, p // 2)) w += p // 2 h += (p + 1) // 2 s = [['#'] * w for _ in range(h)] p, q = 0, 0 for x, y in l: for j in range(p, p + x + 1): for k in range(q, q + y + 1): s[j][k] = '.' p += x q += y print(h, w) for row in s: print(*row, sep='')