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