#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = 0, b = 0, c = 0, d = 0;
  if (n >= 3) {
    c = 1;
    n--;
  }
  while (1) {
    if (n == 0) break;
    a++;
    n--;
    if (n == 0) break;
    b++;
    n--;
    if (n == 0) break;
    d++;
    n--;
    if (n == 0) break;
  }
  cout << "+------------------------+" << endl;
  cout << "|";
  for (int i = 1; i <= a; i++) cout << "O.";
  for (int i = 1; i + a <= 11; i++) cout << "#.";
  cout << "|D|)" << endl;
  cout << "|";
  for (int i = 1; i <= b; i++) cout << "O.";
  for (int i = 1; i + b <= 11; i++) cout << "#.";
  cout << "|.|" << endl;
  if (c == 1)
    cout << "|O.......................|" << endl;
  else
    cout << "|#.......................|" << endl;
  cout << "|";
  for (int i = 1; i <= d; i++) cout << "O.";
  for (int i = 1; i + d <= 11; i++) cout << "#.";
  cout << "|.|)" << endl;
  cout << "+------------------------+" << endl;
}
