#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a[6] = {"+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
                 "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
  switch (n) {
    case 34:
      a[4][21] = 'O';
    case 33:
      a[2][21] = 'O';
    case 32:
      a[1][21] = 'O';
    case 31:
      a[4][19] = 'O';
    case 30:
      a[2][19] = 'O';
    case 29:
      a[1][19] = 'O';
    case 28:
      a[4][17] = 'O';
    case 27:
      a[2][17] = 'O';
    case 26:
      a[1][17] = 'O';
    case 25:
      a[4][15] = 'O';
    case 24:
      a[2][15] = 'O';
    case 23:
      a[1][15] = 'O';
    case 22:
      a[4][13] = 'O';
    case 21:
      a[2][13] = 'O';
    case 20:
      a[1][13] = 'O';
    case 19:
      a[4][11] = 'O';
    case 18:
      a[2][11] = 'O';
    case 17:
      a[1][11] = 'O';
    case 16:
      a[4][9] = 'O';
    case 15:
      a[2][9] = 'O';
    case 14:
      a[1][9] = 'O';
    case 13:
      a[4][7] = 'O';
    case 12:
      a[2][7] = 'O';
    case 11:
      a[1][7] = 'O';
    case 10:
      a[4][5] = 'O';
    case 9:
      a[2][5] = 'O';
    case 8:
      a[1][5] = 'O';
    case 7:
      a[4][3] = 'O';
    case 6:
      a[2][3] = 'O';
    case 5:
      a[1][3] = 'O';
    case 4:
      a[4][1] = 'O';
    case 3:
      a[3][1] = 'O';
    case 2:
      a[2][1] = 'O';
    case 1:
      a[1][1] = 'O';
  }
  for (n = 0; n < 6; n++) cout << a[n] << endl;
  return 0;
}
