#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  printf("+------------------------+\n");
  printf("|");
  if (n >= 1)
    printf("O.");
  else
    printf("#.");
  for (int i = 2; i <= 11; i++)
    if ((i - 2) * 3 + 4 + 1 <= n)
      printf("O.");
    else
      printf("#.");
  printf("|D|)\n");
  printf("|");
  if (n >= 2)
    printf("O.");
  else
    printf("#.");
  for (int i = 2; i <= 11; i++)
    if ((i - 2) * 3 + 4 + 2 <= n)
      printf("O.");
    else
      printf("#.");
  printf("|.|\n");
  if (n >= 3)
    printf("|O.......................|\n");
  else
    printf("|#.......................|\n");
  printf("|");
  if (n >= 4)
    printf("O.");
  else
    printf("#.");
  for (int i = 2; i <= 11; i++)
    if ((i - 2) * 3 + 4 + 3 <= n)
      printf("O.");
    else
      printf("#.");
  printf("|.|)\n");
  printf("+------------------------+\n");
  return 0;
}
