#include <bits/stdc++.h>
using namespace std;
string arr[] = {"+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
                "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int p;
  cin >> p;
  int i = 1, j = 1;
  while (p--) {
    if (arr[i][j] == '.') ++i;
    arr[i][j] = 'O';
    ++i;
    if (i == 5) i = 1, j += 2;
  }
  for (int i = 0; i < 6; ++i) {
    cout << arr[i] << '\n';
  }
  return 0;
}
