#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[6] = {"+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
  int n;
  cin >> n;
  for (int i = 0; i < s[0].length(); ++i) {
    for (int j = 0; j < 6; ++j) {
      if (s[j][i] == '#' && n > 0) {
        s[j][i] = 'O';
        n--;
      }
    }
  }
  for (int i = 0; i < 6; ++i) cout << s[i] << endl;
  return 0;
}
