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