#include <bits/stdc++.h>
char map[4][11];
int main() {
  int n, i, j, x, y;
  scanf("%d", &n);
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 11; j++) {
      map[i][j] = '#';
    }
  }
  for (i = 1; i < 11; i++) map[2][i] = '.';
  x = 0;
  y = 0;
  while (n > 0) {
    if (map[y][x] == '#') {
      map[y][x] = 'O';
      n--;
    }
    y++;
    if (y == 4) {
      y = 0;
      x++;
    }
  }
  printf("+------------------------+\n");
  for (i = 0; i < 4; i++) {
    printf("|");
    for (j = 0; j < 11; j++) {
      printf("%c.", map[i][j]);
    }
    switch (i) {
      case 0:
        printf("|D|)\n");
        break;
      case 1:
        printf("|.|\n");
        break;
      case 2:
        printf("..|\n");
        break;
      case 3:
        printf("|.|)\n");
        break;
    }
  }
  printf("+------------------------+");
  return 0;
}
