#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s1, s2;
  while (cin >> n) {
    vector<string> array(4);
    array[0] = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
    array[3] = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
    array[1] = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
    array[2] = "|#.......................|";
    s1 = array[0].size() - 5, s2 = array[2].size() - 4;
    cout << "+------------------------+" << endl;
    for (int j = 1; j < s1; j += 2) {
      for (long long i = 0; i < 4; i++) {
        if (!i || i == 3 && n) {
          if (!n)
            goto bara;
          else
            array[i][j] = 'O', n--;
        } else if (j == 1 && i == 2 && n)
          array[i][j] = 'O', n--;
        else if (i == 1 && n)
          if (!n)
            goto bara;
          else
            array[i][j] = 'O', n--;
        else if (!n)
          goto bara;
      }
    }
  bara:;
    for (long long i = 0; i < 4; i++) cout << array[i] << endl;
    cout << "+------------------------+" << endl;
  }
  return 0;
}
