#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 11;
  char bus[4][N];
  memset(bus, '#', sizeof(bus));
  memset(bus[2] + 1, '.', N - 1);
  int k;
  scanf("%d", &k);
  for (int i = 0, row = 0, col = 0; i < k; i++) {
    bus[row][col] = 'O';
    row++;
    if (row == 2 && col != 0) {
      row = 3;
    } else if (row == 4) {
      row = 0;
      col++;
    }
  }
  printf("+------------------------+\n");
  for (int row = 0; row < 4; row++) {
    printf("|");
    for (int i = 0; i < N; i++) printf("%c.", bus[row][i]);
    switch (row) {
      case 0:
        printf("|D|)\n");
        break;
      case 1:
        printf("|.|\n");
        break;
      case 2:
        printf("..|\n");
        break;
      case 3:
        printf("|.|)\n");
        break;
    }
  }
  printf("+------------------------+\n");
  return 0;
}
