#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int k = 0;
  int sets[4][11];
  int i = 0, j = 0;
  for (i = 0; i < 4; ++i) {
    for (j = 0; j < 11; ++j) {
      sets[i][j] = 0;
      if (i == 2 && j > 0) sets[i][j] = -1;
    }
  }
  scanf("%d", &k);
  i = 0;
  while (k > 0) {
    if (sets[i % 4][i / 4] == 0) {
      sets[i % 4][i / 4] = 1;
      --k;
    }
    ++i;
  }
  printf("+------------------------+\n");
  for (i = 0; i < 4; ++i) {
    printf("|");
    for (j = 0; j < 11; ++j) {
      if (sets[i][j] == 1) printf("O");
      if (sets[i][j] == 0) printf("#");
      if (sets[i][j] == -1) printf(".");
      printf(".");
    }
    if (i == 0) printf("|D|)\n");
    if (i == 1) printf("|.|\n");
    if (i == 2) printf("..|\n");
    if (i == 3) printf("|.|)\n");
  }
  printf("+------------------------+\n");
  return 0;
}
