#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[6];
  s[0] = "+------------------------+";
  s[1] = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  s[2] = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  s[3] = "|#.......................|";
  s[4] = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  s[5] = "+------------------------+";
  int k, i, j = 3, l;
  cin >> k;
  for (i = 1; i <= min(4, k); i++) s[i][1] = 'O';
  k = k - 4;
  for (i = 1; i <= k; i++) {
    if (i % 3 == 1)
      l = 1;
    else if (i % 3 == 2)
      l = 2;
    else
      l = 4;
    s[l][j] = 'O';
    if (i % 3 == 0) j += 2;
  }
  cout << s[0] << endl
       << s[1] << endl
       << s[2] << endl
       << s[3] << endl
       << s[4] << endl
       << s[5] << endl;
}
