#include <bits/stdc++.h>
using namespace std;
char temp[8][32];
char output[8][32];
void init() {
  strcpy(&temp[0][0], "+------------------------+");
  strcpy(&temp[1][0], "|#.#.#.#.#.#.#.#.#.#.#.|D|)");
  strcpy(&temp[2][0], "|#.#.#.#.#.#.#.#.#.#.#.|.|");
  strcpy(&temp[3][0], "|#.......................|");
  strcpy(&temp[4][0], "|#.#.#.#.#.#.#.#.#.#.#.|.|)");
  strcpy(&temp[5][0], "+------------------------+");
}
void setval(int row, int col) { output[row + 1][2 * col + 1] = 'O'; }
int main() {
  init();
  int k;
  while (~scanf("%d", &k)) {
    memcpy(output, temp, sizeof(temp));
    if (k <= 4) {
      for (int i = 0; i < k; ++i) setval(i, 0);
    } else {
      for (int i = 3; i >= 0; --i) setval(i, 0);
      k -= 4;
      int full_col = k / 3;
      for (int i = 0; i < 4; ++i) {
        if (i == 2) continue;
        for (int j = 1; j <= full_col; ++j) setval(i, j);
      }
      k %= 3;
      for (int i = 0; i < 4 && k; ++i, --k) {
        if (i == 2) continue;
        setval(i, full_col + 1);
      }
    }
    for (int i = 0; i < 6; ++i) {
      printf("%s\n", &output[i][0]);
    }
  }
  return 0;
}
