#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  const int N = 2501;
  vector<vector<int64_t>> dp(N, vector<int64_t>(N));
  for (int i = 1; i < N; i++) {
    for (int j = 1; j < N; j++) {
      dp[i][j] = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1] + (i - 1) * (j - 1);
    }
  }
  vector<tuple<int64_t, int, int>> fs;
  for (int i = 2; i < N; i++) {
    for (int j = 2; j < N; j++) {
      fs.push_back(make_tuple(dp[i][j], i, j));
    }
  }
  sort(fs.begin(), fs.end());
  int64_t k;
  cin >> k;
  vector<string> res(N, string(N, '.'));
  int x = 1;
  while (k > 0) {
    int low = 0, high = int(fs.size()) - 1, p = -1;
    while (low <= high) {
      int mid = low + high >> 1;
      if (get<0>(fs[mid]) <= k) {
        p = mid;
        low = mid + 1;
      } else {
        high = mid - 1;
      }
    }
    assert(p != -1);
    int dx = get<1>(fs[p]);
    int dy = get<2>(fs[p]);
    for (int i = 0; i < dx; i++) {
      for (int j = 1; j <= dy; j++) {
        res[x + i][j] = '#';
      }
    }
    k -= get<0>(fs[p]);
    x += dx + 1;
  }
  cout << 2500 << " " << 2500 << '\n';
  for (int i = 1; i <= 2500; i++) {
    for (int j = 1; j <= 2500; j++) {
      cout << res[i][j];
    }
    cout << '\n';
  }
  return 0;
}