#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  int found;
  string s = "+------------------------+";
  string r1 = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  string r2 = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  string r3 = "|#.......................|";
  string r4 = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  for (int i = 1; i <= k; i++) {
    found = 0;
    for (int j = 1; j <= 21 && !found; j += 2) {
      if (r1[j] == '#') {
        r1[j] = 'O';
        found = 1;
      } else if (r2[j] == '#') {
        r2[j] = 'O';
        found = 1;
      } else if (r3[j] == '#') {
        r3[j] = 'O';
        found = 1;
      } else if (r4[j] == '#') {
        r4[j] = 'O';
        found = 1;
      }
    }
  }
  cout << s << endl
       << r1 << endl
       << r2 << endl
       << r3 << endl
       << r4 << endl
       << s << endl;
}
