#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  char c[6][26];
  for (int64_t i = 0; i < 6; ++i) {
    for (int64_t j = 0; j < 26; ++j) {
      if (i == 0 or i == 5)
        c[i][j] = '-';
      else
        c[i][j] = '.';
    }
  }
  c[0][0] = c[0][25] = c[5][25] = c[5][0] = '+';
  c[1][0] = c[2][0] = c[3][0] = c[4][0] = c[1][25] = c[2][25] = c[3][25] =
      c[4][25] = '|';
  c[1][24] = 'D';
  c[1][23] = c[2][23] = c[4][23] = '|';
  for (int64_t i = 1; i < 5; ++i) {
    if (i == 3) continue;
    for (int64_t j = 1; j < 23; j += 2) {
      c[i][j] = '#';
    }
  }
  c[3][1] = '#';
  int64_t n;
  cin >> n;
  for (int64_t j = 1; j < 23; j += 2) {
    for (int64_t i = 1; i < 5 and n > 0; i++) {
      if (i == 3 and j > 1)
        continue;
      else if (c[i][j] == '#') {
        c[i][j] = 'O';
        n--;
      }
    }
  }
  for (int64_t i = 0; i < 6; ++i) {
    for (int64_t j = 0; j < 26; ++j) {
      cout << c[i][j];
    }
    if (i == 1 or i == 4) cout << ")";
    cout << '\n';
  }
}
