#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  cout << "+------------------------+\n";
  for (int j = 0; j < 4; ++j) {
    cout << "|";
    for (int i = 0; i < 11; ++i) {
      if (i == 0) {
        cout << ((n > j) ? "O" : "#") << ".";
      } else {
        if (j == 2) {
          cout << "..";
        } else {
          cout << ((n > i * 3 + (j < 3 ? j + 1 : j)) ? "O" : "#") << ".";
        }
      }
    }
    if (j == 0) {
      cout << "|D|)\n";
    } else if (j == 1) {
      cout << "|.|\n";
    } else if (j == 2) {
      cout << "..|\n";
    } else if (j == 3) {
      cout << "|.|)\n";
    }
  }
  cout << "+------------------------+\n";
  return 0;
}
