#include <bits/stdc++.h>
using namespace std;
char a[5][15];
int main() {
  int n;
  scanf("%d", &n);
  if (n >= 3) {
    a[2][0] = 'O';
    n -= 1;
    for (int i = 1; i < 11; i++) a[2][i] = '.';
  } else {
    a[2][0] = '#';
    for (int i = 1; i < 11; i++) a[2][i] = '.';
  }
  int sum = 0, flag = 0;
  for (int i = 0; i < 11; i++) {
    for (int j = 0; j < 4; j++) {
      if (sum == n) {
        flag = 1;
        break;
      }
      if (j == 2) continue;
      a[j][i] = 'O';
      sum += 1;
    }
    if (flag == 1) break;
  }
  for (int i = 0; i < 11; i++) {
    for (int j = 0; j < 4; j++) {
      if (j == 2) continue;
      if (a[j][i] != 'O') a[j][i] = '#';
    }
  }
  printf("+------------------------+\n");
  for (int i = 0; i < 4; i++) {
    printf("|");
    for (int j = 0; j < 11; j++) {
      printf("%c.", a[i][j]);
    }
    if (i == 0)
      printf("|D|)\n");
    else if (i == 1)
      printf("|.|\n");
    else if (i == 2)
      printf("..|\n");
    else if (i == 3)
      printf("|.|)\n");
  }
  printf("+------------------------+\n");
  return 0;
}
