#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int n;
  cin >> n;
  cout << "+------------------------+" << endl;
  s = "|";
  if (n > 0) {
    s += "O.";
  } else
    s += "#.";
  if (n > 4)
    s += "O.";
  else
    s += "#.";
  for (int i = 1; i < 10; i++) {
    if (n > (4 + i * 3))
      s += "O.";
    else
      s += "#.";
  }
  s += "|D|)";
  cout << s << endl;
  s = "|";
  if (n > 1) {
    s += "O.";
  } else
    s += "#.";
  if (n > 5)
    s += "O.";
  else
    s += "#.";
  for (int i = 1; i < 10; i++) {
    if (n > (4 + i * 3 + 1))
      s += "O.";
    else
      s += "#.";
  }
  s += "|.|";
  cout << s << endl;
  if (n > 2)
    cout << "|O.......................|" << endl;
  else
    cout << "|#.......................|" << endl;
  s = "|";
  if (n > 3) {
    s += "O.";
  } else
    s += "#.";
  if (n > 6)
    s += "O.";
  else
    s += "#.";
  for (int i = 1; i < 10; i++) {
    if (n > (4 + i * 3 + 2))
      s += "O.";
    else
      s += "#.";
  }
  s += "|.|)";
  cout << s << endl;
  cout << "+------------------------+" << endl;
  return 0;
}
