#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int i, j, k;
  string s[4];
  s[0] = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  s[1] = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  s[2] = "|#.......................|";
  s[3] = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  cin >> k;
  cout << "+------------------------+\n";
  if (k > 2) {
    s[2] = "|O.......................|";
    k--;
  }
  for (i = 1; k > 0; i += 2) {
    for (j = 0; j < 4 && k > 0; j++) {
      if (i != 1 && j == 2)
        continue;
      else if (s[j][i] == '#') {
        s[j][i] = 'O';
        k--;
      }
    }
  }
  for (i = 0; i < 4; i++) cout << s[i] << "\n";
  cout << "+------------------------+\n";
  return 0;
}
