#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  int arr[11] = {0};
  cin >> n;
  cout << "+------------------------+\n";
  if (n >= 4) {
    arr[0] = 4;
    n -= 4;
  } else {
    arr[0] = n;
    n = 0;
  }
  int ij = 1;
  while (n > 0) {
    arr[ij] = min(3, n);
    n -= arr[ij];
    ++ij;
  }
  cout << "|";
  for (int i = 0; i < 11; ++i) {
    if (arr[i]) {
      cout << "O";
      --arr[i];
    } else {
      cout << "#";
    }
    cout << ".";
  }
  cout << "|D|)\n|";
  for (int i = 0; i < 11; ++i) {
    if (arr[i]) {
      cout << "O";
      --arr[i];
    } else {
      cout << "#";
    }
    cout << ".";
  }
  cout << "|.|\n";
  if (arr[0]) {
    cout << "|O.......................|\n|";
    --arr[0];
  } else {
    cout << "|#.......................|\n|";
  }
  for (int i = 0; i < 11; ++i) {
    if (arr[i]) {
      cout << "O";
      --arr[i];
    } else {
      cout << "#";
    }
    cout << ".";
  }
  cout << "|.|)\n";
  cout << "+------------------------+\n";
  return 0;
}
