#include <bits/stdc++.h>
using namespace std;
const int N = 100;
bool d[N][N];
int main() {
  int k, n, m, i, j;
  bool ok;
  scanf("%d", &k);
  n = 4;
  m = 11;
  for (j = 1; j < m; ++j) d[2][j] = 1;
  while (k--) {
    ok = false;
    for (j = 0; !ok; ++j)
      for (i = 0; (i < n) && !ok; ++i)
        if (!d[i][j]) {
          d[i][j] = true;
          ok = true;
        }
  }
  printf("+------------------------+\n");
  for (i = 0; i < n; ++i) {
    printf("|");
    for (j = 0; j < m; ++j)
      if ((i == 2) && j)
        printf("..");
      else
        printf("%c.", (d[i][j]) ? 'O' : '#');
    if (i == 2)
      printf("..|");
    else if (i)
      printf("|.|");
    else
      printf("|D|)");
    if (i == 3) printf(")");
    printf("\n");
  }
  printf("+------------------------+\n");
  return 0;
}
