#include <bits/stdc++.h>
using namespace std;
string grid[7] = {"+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                  "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
                  "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
int main() {
  int n;
  cin >> n;
  int j = 0;
  for (int i = 0; i < grid[0].size(); i++) {
    for (int j = 0; j < 6; j++) {
      if (grid[j][i] == '#') grid[j][i] = 'O', n--;
      if (!n) break;
    }
    if (!n) break;
  }
  for (int i = 0; i < 6; i++) cout << grid[i] << '\n';
}
