#include <bits/stdc++.h>
using namespace std;
int n;
char maz[100][30] = {
    "+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
    "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
    "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
char m[100][30];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 27; ++i) {
    for (int j = 0; j < 6; ++j) {
      if (maz[j][i] == '#') {
        if (n)
          --n, m[j][i] = 'O';
        else
          m[j][i] = maz[j][i];
      } else
        m[j][i] = maz[j][i];
    }
  }
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < strlen(maz[i]); ++j) {
      printf("%c", m[i][j]);
    }
    puts("");
  }
  return 0;
}
