#include <bits/stdc++.h>
using namespace std;
class problem {
  vector<string> pattern = {
      "+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
      "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
      "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
  const int pos[34][2] = {{1, 1},  {2, 1},  {3, 1},  {4, 1},  {1, 3},  {2, 3},
                          {4, 3},  {1, 5},  {2, 5},  {4, 5},  {1, 7},  {2, 7},
                          {4, 7},  {1, 9},  {2, 9},  {4, 9},  {1, 11}, {2, 11},
                          {4, 11}, {1, 13}, {2, 13}, {4, 13}, {1, 15}, {2, 15},
                          {4, 15}, {1, 17}, {2, 17}, {4, 17}, {1, 19}, {2, 19},
                          {4, 19}, {1, 21}, {2, 21}, {4, 21}};
  void printBusMap(int k) const {
    vector<string> result(pattern.begin(), pattern.end());
    for (int i = (0); i <= (int)((k)-1); ++i)
      result[pos[i][0]][pos[i][1]] = 'O';
    for (int i = (0); i <= (int)((result.size()) - 1); ++i)
      cout << result[i] << endl;
  }

 public:
  problem() { ios_base::sync_with_stdio(false); }
  void solve() {
    int n;
    cin >> n;
    printBusMap(n);
  }
};
int main() {
  problem *p = new problem();
  p->solve();
  return 0;
}
