#include <iostream> #include <vector> #include <string> #include <cstdint> using i64 = std::int64_t; i64 ways(i64 N, i64 M) { return 1LL * N * (N - 1) / 2 * M * (M - 1) / 2; } int main() { std::ios_base::sync_with_stdio(false); i64 K; std::cin >> K; std::vector<std::pair<int, int>> pairs; auto tmp_K = K; while (K > 0) { int start = 2001; int end = 1; int sign = -1; bool found = false; for (int N = start; N != end; N += sign) { for (int M = start; M != end; M += sign) { if (ways(N, M) <= K && K > 0) { pairs.emplace_back(N, M); // std::cerr << ways(N, M) << " " << K << "\n"; K -= ways(N, M); // found = true; // break; // std::cerr << "new K = " << K << "\n"; } } } } const int H = 2025; const int W = 2025; // std::cerr << pairs.size() << "\n"; // for (const auto& [x, y] : pairs) { // std::cerr << x << " " << y << "\n"; // } std::vector<std::string> mat(H, std::string(W, '.')); int line = 0, col = 0; int max_line_before = 0; for (const auto& [x, y] : pairs) { if (col + 1 + y >= W) { line = max_line_before + 2; col = 0; max_line_before = x; } // std::cerr << "at " << line << " and " << col << "\n"; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { mat[i + line][j + col] = '#'; } } max_line_before = std::max(max_line_before, x); col += y + 1; } std::cout << H << " " << W << "\n"; for (const std::string& S : mat) { std::cout << S << "\n"; } return 0; }