#include <bits/stdc++.h>
using namespace std;
string str[6];
void done() {
  for (int i = 0; i < 6; i++) {
    cout << str[i] << endl;
  }
  exit(0);
}
int d(int j) {
  if (j == 0) return 1;
  if (j == 1) return 2;
  if (j == 2) return 4;
  return -1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  str[0] = "+------------------------+";
  str[1] = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  str[2] = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  str[3] = "|#.......................|";
  str[4] = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  str[5] = "+------------------------+";
  if (!n) done();
  for (int i = 1; i < 5; i++) {
    str[i][1] = 'O';
    n--;
    if (!n) done();
  }
  for (int i = 3; i < 22; i += 2) {
    for (int j = 0; j < 3; j++) {
      str[d(j)][i] = 'O';
      n--;
      if (!n) done();
    }
  }
  done();
}
