#include <bits/stdc++.h>
using namespace std;
int main() {
  int k = 0;
  int rem = 0, rem1;
  int div = 0;
  cin >> k;
  cout << "+";
  for (int f = 0; f < 24; f++) cout << "-";
  cout << "+\n";
  if (k <= 4) {
    for (int i = 0; i < 4; i++) {
      cout << "|";
      for (int j = 0; j < 12; j++) {
        if (j == 0 && k > 0) {
          cout << "O.";
          k--;
        } else if (j == 11 && i == 0)
          cout << "|D|)";
        else if (j == 11 && i > 0 && i != 3 && i != 2)
          cout << "|.|";
        else if (j == 11 && i == 3)
          cout << "|.|)";
        else if (j == 11 && i == 2)
          cout << "..|";
        else if (j > 0 && i == 2)
          cout << "..";
        else
          cout << "#.";
      }
      cout << "\n";
    }
  }
  if (k > 4) {
    rem = k - 4;
    {
      div = rem / 3;
      rem1 = rem % 3;
    }
    bool flag = true;
    for (int i = 0; i < 4; i++) {
      cout << "|";
      for (int j = 0; j < 12; j++) {
        if (j == 0)
          cout << "O.";
        else if (j > 0 && i != 2 && j <= div) {
          cout << "O.";
        } else if (j == 11 && i == 0)
          cout << "|D|)";
        else if (j == 11 && i == 2)
          cout << "..|";
        else if (j > 0 && i == 2)
          cout << "..";
        else if (rem1 > 0 && j > div && flag) {
          cout << "O.";
          flag = false;
        } else if (j == 11 && i > 0 && i != 3)
          cout << "|.|";
        else if (j == 11 && i == 3)
          cout << "|.|)";
        else
          cout << "#.";
      }
      rem1--;
      flag = true;
      cout << "\n";
    }
  }
  cout << "+";
  for (int f = 0; f < 24; f++) cout << "-";
  cout << "+\n";
  return 0;
}
