#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
void init() {
  iostream::sync_with_stdio(false);
  cout << fixed << setprecision(20);
}
unsigned long xor128() {
  static unsigned long x = 123456789, y = 362436069, z = 521288629,
                       w = 88675123;
  unsigned long t = (x ^ (x << 11));
  x = y;
  y = z;
  z = w;
  return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
void solve() {
  long long k;
  cin >> k;
  string s[6] = {"+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
  for (long long i = 0; i < k; ++i) {
    for (long long q = 0;; ++q) {
      for (long long j = 0; j < 6; ++j) {
        if (s[j][q] == '#') {
          s[j][q] = 'O';
          goto go;
        }
      }
    }
  go:;
  }
  for (long long i = 0; i < 6; ++i) {
    cout << s[i] << endl;
  }
}
int main() {
  init();
  solve();
}
