#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  char a[4][11];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 11; j++) {
      if (i == 2 && j > 0) {
        a[i][j] = '.';
      } else {
        a[i][j] = '#';
      }
    }
  }
  cin >> k;
  for (int i = 0; i < 11; i++) {
    for (int j = 0; j < 4; j++) {
      if (a[j][i] == '#' && k > 0) {
        a[j][i] = 'O';
        k--;
      } else if (k < 0) {
        j = 4;
        i = 11;
      }
    }
  }
  cout << "+";
  for (int i = 0; i < 24; i++) {
    cout << "-";
  }
  cout << "+\n";
  for (int i = 0; i < 4; i++) {
    cout << "|";
    for (int j = 0; j < 11; j++) {
      cout << a[i][j] << ".";
    }
    if (i != 2) {
      cout << "|";
    } else {
      cout << ".";
    }
    if (i == 0) {
      cout << "D";
    } else {
      cout << ".";
    }
    cout << "|";
    if (i == 0 || i == 3) {
      cout << ")";
    }
    cout << endl;
  }
  cout << "+";
  for (int i = 0; i < 24; i++) {
    cout << "-";
  }
  cout << "+\n";
  return 0;
}
