#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[400];
int v[] = {1, 2, 4};
bool b[10][400];
int main() {
  cin.sync_with_stdio(false);
  int k;
  cin >> k;
  int x = 1;
  a[1] = make_pair(1, 1);
  a[2] = make_pair(2, 1);
  a[3] = make_pair(3, 1);
  a[4] = make_pair(4, 1);
  x = 5;
  for (int j = 2; j <= 11; ++j)
    for (int i = 0; i < 3; ++i) a[x++] = make_pair(v[i], j);
  for (int i = 1; i <= k; ++i) {
    b[a[i].first][a[i].second] = 1;
  }
  cout << "+------------------------+\n";
  cout << "|";
  for (int i = 1; i <= 11; ++i)
    if (b[1][i])
      cout << "O.";
    else
      cout << "#.";
  cout << "|D|)\n";
  for (int i = 2; i <= 4; ++i) {
    cout << "|";
    for (int j = 1; j <= 11; ++j)
      if (i != 3) {
        if (b[i][j])
          cout << "O.";
        else
          cout << "#.";
      } else {
        if (j > 1)
          cout << "..";
        else {
          if (b[i][j])
            cout << "O.";
          else
            cout << "#.";
        }
      }
    if (i != 3)
      cout << "|.|";
    else
      cout << "..|";
    if (i != 4) cout << "\n";
  }
  cout << ")\n";
  cout << "+------------------------+";
  return 0;
}
