#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  scanf("%d", &k);
  printf("+------------------------+\n");
  if (k == 0)
    printf(
        "|#.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#..........."
        "............|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 1)
    printf(
        "|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#..........."
        "............|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 2)
    printf(
        "|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#.#.#.#.#.#.#.#.|.|\n|#..........."
        "............|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 3)
    printf(
        "|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 4)
    printf(
        "|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 5)
    printf(
        "|O.O.#.#.#.#.#.#.#.#.#.|D|)\n|O.#.#.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 6)
    printf(
        "|O.O.#.#.#.#.#.#.#.#.#.|D|)\n|O.O.#.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.#.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 7)
    printf(
        "|O.O.#.#.#.#.#.#.#.#.#.|D|)\n|O.O.#.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 8)
    printf(
        "|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.#.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 9)
    printf(
        "|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.O.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.#.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 10)
    printf(
        "|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.O.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 11)
    printf(
        "|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.#.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 12)
    printf(
        "|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.O.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.#.#.#.#.#.#.#.#.|.|)\n");
  if (k == 13)
    printf(
        "|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.O.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.#.#.#.#.#.#.#.|.|)\n");
  if (k == 14)
    printf(
        "|O.O.O.O.O.#.#.#.#.#.#.|D|)\n|O.O.O.O.#.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.#.#.#.#.#.#.#.|.|)\n");
  if (k == 15)
    printf(
        "|O.O.O.O.O.#.#.#.#.#.#.|D|)\n|O.O.O.O.O.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.#.#.#.#.#.#.#.|.|)\n");
  if (k == 16)
    printf(
        "|O.O.O.O.O.#.#.#.#.#.#.|D|)\n|O.O.O.O.O.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.#.#.#.#.#.#.|.|)\n");
  if (k == 17)
    printf(
        "|O.O.O.O.O.O.#.#.#.#.#.|D|)\n|O.O.O.O.O.#.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.#.#.#.#.#.#.|.|)\n");
  if (k == 18)
    printf(
        "|O.O.O.O.O.O.#.#.#.#.#.|D|)\n|O.O.O.O.O.O.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.#.#.#.#.#.#.|.|)\n");
  if (k == 19)
    printf(
        "|O.O.O.O.O.O.#.#.#.#.#.|D|)\n|O.O.O.O.O.O.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.#.#.#.#.#.|.|)\n");
  if (k == 20)
    printf(
        "|O.O.O.O.O.O.O.#.#.#.#.|D|)\n|O.O.O.O.O.O.#.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.#.#.#.#.#.|.|)\n");
  if (k == 21)
    printf(
        "|O.O.O.O.O.O.O.#.#.#.#.|D|)\n|O.O.O.O.O.O.O.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.#.#.#.#.#.|.|)\n");
  if (k == 22)
    printf(
        "|O.O.O.O.O.O.O.#.#.#.#.|D|)\n|O.O.O.O.O.O.O.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.#.#.#.#.|.|)\n");
  if (k == 23)
    printf(
        "|O.O.O.O.O.O.O.O.#.#.#.|D|)\n|O.O.O.O.O.O.O.#.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.#.#.#.#.|.|)\n");
  if (k == 24)
    printf(
        "|O.O.O.O.O.O.O.O.#.#.#.|D|)\n|O.O.O.O.O.O.O.O.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.#.#.#.#.|.|)\n");
  if (k == 25)
    printf(
        "|O.O.O.O.O.O.O.O.#.#.#.|D|)\n|O.O.O.O.O.O.O.O.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.#.#.#.|.|)\n");
  if (k == 26)
    printf(
        "|O.O.O.O.O.O.O.O.O.#.#.|D|)\n|O.O.O.O.O.O.O.O.#.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.#.#.#.|.|)\n");
  if (k == 27)
    printf(
        "|O.O.O.O.O.O.O.O.O.#.#.|D|)\n|O.O.O.O.O.O.O.O.O.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.#.#.#.|.|)\n");
  if (k == 28)
    printf(
        "|O.O.O.O.O.O.O.O.O.#.#.|D|)\n|O.O.O.O.O.O.O.O.O.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.#.#.|.|)\n");
  if (k == 29)
    printf(
        "|O.O.O.O.O.O.O.O.O.O.#.|D|)\n|O.O.O.O.O.O.O.O.O.#.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.#.#.|.|)\n");
  if (k == 30)
    printf(
        "|O.O.O.O.O.O.O.O.O.O.#.|D|)\n|O.O.O.O.O.O.O.O.O.O.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.#.#.|.|)\n");
  if (k == 31)
    printf(
        "|O.O.O.O.O.O.O.O.O.O.#.|D|)\n|O.O.O.O.O.O.O.O.O.O.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.O.#.|.|)\n");
  if (k == 32)
    printf(
        "|O.O.O.O.O.O.O.O.O.O.O.|D|)\n|O.O.O.O.O.O.O.O.O.O.#.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.O.#.|.|)\n");
  if (k == 33)
    printf(
        "|O.O.O.O.O.O.O.O.O.O.O.|D|)\n|O.O.O.O.O.O.O.O.O.O.O.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.O.#.|.|)\n");
  if (k == 34)
    printf(
        "|O.O.O.O.O.O.O.O.O.O.O.|D|)\n|O.O.O.O.O.O.O.O.O.O.O.|.|\n|O..........."
        "............|\n|O.O.O.O.O.O.O.O.O.O.O.|.|)\n");
  printf("+------------------------+");
  return 0;
}
