#include <bits/stdc++.h>
using namespace std;
int main() {
  string l1 = "+------------------------+";
  string l2 = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  string l3 = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  string l4 = "|#.......................|";
  string l5 = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  string l6 = "+------------------------+";
  int k;
  cin >> k;
  string seats[3];
  seats[0] = l2;
  seats[1] = l3;
  seats[2] = l5;
  if (k >= 3) {
    l4.replace(1, 1, "O");
    k = k - 1;
  }
  int row = k / 3;
  int remain = k % 3;
  for (int i = 0; i < row; i++) {
    l2.replace(l2.find("#"), 1, "O");
    l3.replace(l3.find("#"), 1, "O");
    l5.replace(l5.find("#"), 1, "O");
  }
  if (remain > 0) l2.replace(l2.find("#"), 1, "O");
  if (remain > 1) l3.replace(l3.find("#"), 1, "O");
  cout << l1 << endl;
  cout << l2 << endl;
  cout << l3 << endl;
  cout << l4 << endl;
  cout << l5 << endl;
  cout << l6 << endl;
  return 0;
}
