#include <bits/stdc++.h>
using namespace std;
int a;
int main() {
  cin >> a;
  if (a == 0)
    cout << "+------------------------+" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|#.......................|" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 1)
    cout << "+------------------------+" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|#.......................|" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 2)
    cout << "+------------------------+" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|#.......................|" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 3)
    cout << "+------------------------+" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|#.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 4)
    cout << "+------------------------+" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 5)
    cout << "+------------------------+" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 6)
    cout << "+------------------------+" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.#.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 7)
    cout << "+------------------------+" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 8)
    cout << "+------------------------+" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 9)
    cout << "+------------------------+" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.#.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 10)
    cout << "+------------------------+" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 11)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 12)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.#.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 13)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 14)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 15)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.#.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 16)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 17)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 18)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.#.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 19)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 20)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 21)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.#.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 22)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 23)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 24)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.#.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 25)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 26)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 27)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.#.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 28)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 29)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 30)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.#.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 31)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 32)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.O.O.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 33)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.O.O.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.O.O.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.O.#.|.|)" << endl
         << "+------------------------+";
  else if (a == 34)
    cout << "+------------------------+" << endl
         << "|O.O.O.O.O.O.O.O.O.O.O.|D|)" << endl
         << "|O.O.O.O.O.O.O.O.O.O.O.|.|" << endl
         << "|O.......................|" << endl
         << "|O.O.O.O.O.O.O.O.O.O.O.|.|)" << endl
         << "+------------------------+";
  return 0;
}
