#include <bits/stdc++.h>
using namespace std;
int main() {
  int pasajeros, lineas, extra;
  cin >> pasajeros;
  if (pasajeros >= 4) {
    pasajeros = pasajeros - 4;
    extra = ceil(pasajeros % 3);
    cout << "+------------------------+";
    lineas = pasajeros / 3;
    if (extra > 0) {
      lineas++;
      extra--;
    }
    cout << endl << "|O.";
    for (int i = 0; i < 10; i++) {
      if (lineas > 0) {
        cout << "O";
        lineas--;
      } else
        cout << "#";
      cout << ".";
    }
    cout << "|D|)";
    lineas = pasajeros / 3;
    if (extra > 0) {
      lineas++;
      extra--;
    }
    cout << endl << "|O.";
    for (int i = 0; i < 10; i++) {
      if (lineas > 0) {
        cout << "O";
        lineas--;
      } else
        cout << "#";
      cout << ".";
    }
    cout << "|.|";
    cout << endl << "|O.......................|";
    lineas = pasajeros / 3;
    if (extra > 0) {
      lineas++;
      extra--;
    }
    cout << endl << "|O.";
    for (int i = 0; i < 10; i++) {
      if (lineas > 0) {
        cout << "O";
        lineas--;
      } else
        cout << "#";
      cout << ".";
    }
    cout << "|.|)";
    cout << endl << "+------------------------+";
  } else {
    cout << "+------------------------+";
    cout << endl << "|";
    if (pasajeros > 0) {
      cout << "O";
      pasajeros--;
    } else
      cout << "#";
    cout << ".#.#.#.#.#.#.#.#.#.#.|D|)";
    cout << endl << "|";
    if (pasajeros > 0) {
      cout << "O";
      pasajeros--;
    } else
      cout << "#";
    cout << ".#.#.#.#.#.#.#.#.#.#.|.|";
    cout << endl << "|";
    if (pasajeros > 0) {
      cout << "O";
      pasajeros--;
    } else
      cout << "#";
    cout << ".......................|";
    cout << endl << "|";
    if (pasajeros > 0) {
      cout << "O";
      pasajeros--;
    } else
      cout << "#";
    cout << ".#.#.#.#.#.#.#.#.#.#.|.|)" << endl;
    cout << "+------------------------+";
  }
}
