#include <bits/stdc++.h>
using namespace std;
int n;
string a[10];
void init() {
  a[0] = "+------------------------+";
  a[1] = "|#.#.#.#.#.#.#.#.#.#.#.|D|)";
  a[2] = "|#.#.#.#.#.#.#.#.#.#.#.|.|";
  a[3] = "|#.......................|";
  a[4] = "|#.#.#.#.#.#.#.#.#.#.#.|.|)";
  a[5] = "+------------------------+";
}
int main() {
  int i, j;
  while (scanf("%d", &n) != EOF) {
    init();
    for (i = 1; i <= 4 && i <= n; ++i) a[i][1] = 'O';
    n -= 4;
    while (n > 0) {
      for (i = 1;; i += 2) {
        if (a[1][i] != 'O') {
          a[1][i] = 'O';
          n--;
          break;
        }
      }
      if (n)
        for (i = 1;; i += 2) {
          if (a[2][i] != 'O') {
            a[2][i] = 'O';
            n--;
            break;
          }
        }
      if (n)
        for (i = 1;; i += 2) {
          if (a[4][i] != 'O') {
            a[4][i] = 'O';
            n--;
            break;
          }
        }
    }
    for (i = 0; i <= 5; ++i) cout << a[i] << endl;
  }
  return 0;
}
