#include <bits/stdc++.h>
using namespace std;
int main() {
  string matrix[] = {
      "+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
      "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
      "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
  int k;
  scanf("%d", &(k));
  int start = 1;
  int end = 4;
  int ct = 0;
  while (1) {
    if (k == 0) break;
    for (int i = start; i <= end; i++) {
      if (k == 0) break;
      if (matrix[i][ct] == '#') {
        matrix[i][ct] = 'O';
        k--;
      }
    }
    ct++;
  }
  for (int i = (0); i < (6); ++i) cout << matrix[i] << endl;
  return 0;
}
