#include <bits/stdc++.h>
using namespace std;
char grid[6][26];
int main(void) {
  memset(grid, '.', sizeof grid);
  int n;
  scanf("%d", &n);
  grid[1][24] = 'D';
  grid[0][0] = grid[5][0] = grid[0][25] = grid[5][25] = '+';
  grid[1][25] = grid[2][25] = grid[3][25] = grid[4][25] = '|';
  grid[1][0] = grid[2][0] = grid[3][0] = grid[4][0] = '|';
  grid[1][23] = grid[2][23] = grid[4][23] = '|';
  for (int k = 1; k < 25; ++k) {
    grid[0][k] = grid[5][k] = '-';
  }
  for (int si = 1, sj = 1; sj < 22; ++si) {
    if (si > 4) si %= 4, sj += 2;
    if (sj > 21) break;
    if (si == 3 && sj != 1) {
      continue;
    }
    if (n) {
      grid[si][sj] = 'O';
      n--;
    } else {
      grid[si][sj] = '#';
    }
  }
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < 26; ++j) {
      printf("%c", grid[i][j]);
    }
    if (i == 1 || i == 4)
      puts(")");
    else
      putchar('\n');
  }
}
