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