#include <bits/stdc++.h>
using namespace std;
int getint() {
  int s = 0, o = 1;
  char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') o = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) s *= 10, s += c - '0';
  return s * o;
}
const int maxn = 2010, oo = 100000000, maxlen = 500010;
int n, a[100][100];
void work(int o) {
  for (int i = 0; i < 11; i++) {
    if (a[o][i])
      printf("O");
    else if (o == 3 && i)
      printf(".");
    else
      printf("#");
    printf(".");
  }
}
int main(int argc, char const *argv[]) {
  int n = getint();
  if (n > 2) a[3][0] = 1, --n;
  int j = 0;
  while (n) {
    for (int i = 0; i < 3; i++) {
      a[i][j] = 1;
      --n;
      if (n == 0) break;
    }
    ++j;
  }
  printf("+------------------------+\n");
  printf("|");
  work(0);
  printf("|D|)\n");
  printf("|");
  work(1);
  printf("|.|\n");
  printf("|");
  work(3);
  printf("..|\n");
  printf("|");
  work(2);
  printf("|.|)\n");
  printf("+------------------------+\n");
  return 0;
}
