#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  cin >> n;
  cout << "+------------------------+" << endl;
  cout << (n >= 1 ? "|O." : "|#.");
  for (i = 5; i <= 32; i += 3) {
    cout << (n >= i ? "O" : "#") << ".";
  }
  cout << "|D|)" << endl;
  cout << (n >= 2 ? "|O." : "|#.");
  for (i = 6; i <= 33; i += 3) {
    cout << (n >= i ? "O" : "#") << ".";
  }
  cout << "|.|" << endl;
  cout << (n >= 3 ? "|O." : "|#.");
  cout << "......................|" << endl;
  cout << "|";
  for (i = 4; i <= 34; i += 3) {
    cout << (n >= i ? "O" : "#") << ".";
  }
  cout << "|.|)" << endl;
  cout << "+------------------------+" << endl;
  return 0;
}
