#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int i, j, x, n, m, k, t;
  cin >> n;
  cout << ("+------------------------+\n|");
  if (n)
    cout << ("O.");
  else
    cout << ("#.");
  for (i = 5; i <= 32; i += 3)
    if (n >= i)
      cout << ("O.");
    else
      cout << ("#.");
  cout << ("|D|)\n");
  if (n >= 2)
    cout << ("|O.");
  else
    cout << ("|#.");
  for (i = 6; i <= 34; i += 3)
    if (n >= i)
      cout << ("O.");
    else
      cout << ("#.");
  cout << ("|.|\n");
  if (n >= 3)
    cout << ("|O");
  else
    cout << ("|#");
  cout << (".......................|\n");
  if (n >= 4)
    cout << ("|O.");
  else
    cout << ("|#.");
  for (i = 7; i <= 34; i += 3)
    if (n >= i)
      cout << ("O.");
    else
      cout << ("#.");
  cout << ("|.|)\n");
  cout << ("+------------------------+\n");
  return 0;
}
