#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str1 = "+------------------------+",
         str2 = "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
         str3 = "|#.#.#.#.#.#.#.#.#.#.#.|.|",
         str4 = "|#.......................|",
         str5 = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  if (n == 0) {
    cout << str1 << "\n"
         << str2 << "\n"
         << str3 << "\n"
         << str4 << "\n"
         << str5 << "\n"
         << str1;
    return 0;
  }
  if (n >= 3) {
    n--;
    str4[1] = 'O';
  }
  int first = (n) / 3;
  if ((n) % 3 > 0) first++;
  for (int i = 1; first > 0; first--, i += 2, n--) str2[i] = 'O';
  first = (n) / 2;
  if ((n) % 2 > 0) first++;
  for (int i = 1; first > 0; first--, i += 2, n--) str3[i] = 'O';
  first = (n);
  for (int i = 1; first > 0; first--, i += 2, n--) str5[i] = 'O';
  cout << str1 << "\n"
       << str2 << "\n"
       << str3 << "\n"
       << str4 << "\n"
       << str5 << "\n"
       << str1;
}
