#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  cout << "+------------------------+" << endl;
  char b[3][10] = {'#'};
  if (k < 5) {
    k--;
    if (k > -1)
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
    else
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|D|)" << endl;
    k--;
    if (k > -1)
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
    else
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|" << endl;
    k--;
    if (k > -1)
      cout << "|O.......................|" << endl;
    else
      cout << "|#.......................|" << endl;
    k--;
    if (k > -1)
      cout << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
    else
      cout << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
    cout << "+------------------------+" << endl;
    return 0;
  }
  int i = 0, j = 0;
  k -= 4;
  while (k--) {
    b[i][j] = 'O';
    i++;
    if (i == 3) {
      i = 0;
      j++;
    }
  }
  cout << "|O.";
  for (int i = 0; i < 10; i++) {
    if (b[0][i] == 'O')
      cout << 'O';
    else
      cout << '#';
    cout << '.';
  }
  cout << "|D|)" << endl;
  cout << "|O.";
  for (int i = 0; i < 10; i++) {
    if (b[1][i] == 'O')
      cout << 'O';
    else
      cout << '#';
    cout << '.';
  }
  cout << "|.|" << endl;
  cout << "|O.......................|" << endl;
  cout << "|O.";
  for (int i = 0; i < 10; i++) {
    if (b[2][i] == 'O')
      cout << 'O';
    else
      cout << '#';
    cout << '.';
  }
  cout << "|.|)" << endl;
  cout << "+------------------------+" << endl;
  return 0;
}
