#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> pic;
  pic.push_back("+------------------------+");
  pic.push_back("|#.#.#.#.#.#.#.#.#.#.#.|D|)");
  pic.push_back("|#.#.#.#.#.#.#.#.#.#.#.|.|");
  pic.push_back("|#.......................|");
  pic.push_back("|#.#.#.#.#.#.#.#.#.#.#.|.|)");
  pic.push_back("+------------------------+");
  int n;
  int place[11];
  for (int i = (0); i <= int(10); ++i) place[i] = 0;
  cin >> n;
  if (n >= 4) {
    place[0] = 4;
    n -= 4;
  } else {
    place[0] = n;
    n = 0;
  }
  int i = 1;
  while (n > 0) {
    if (n >= 3) {
      place[i] = 3;
      n -= 3;
    } else {
      place[i] = n;
      n = 0;
    }
    ++i;
  }
  for (int i = 1; place[0]--; ++i) {
    pic[i][1] = 'O';
  }
  for (int j = 1; j < 11; ++j) {
    switch (place[j]) {
      case 3:
        pic[1][1 + j * 2] = 'O';
        pic[2][1 + j * 2] = 'O';
        pic[4][1 + j * 2] = 'O';
        break;
      case 2:
        pic[1][1 + j * 2] = 'O';
        pic[2][1 + j * 2] = 'O';
        break;
      case 1:
        pic[1][1 + j * 2] = 'O';
        break;
      case 0:
        for (int i = 0; i < pic.size(); ++i) cout << pic[i] << endl;
        return 0;
        break;
    }
  }
  for (int i = 0; i < pic.size(); ++i) cout << pic[i] << endl;
  return 0;
}
