#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d;
  while (cin >> n) {
    a = b = c = d = 0;
  x:
    if (n > 0) {
      a++;
      n--;
    }
    if (n > 0) {
      b++;
      n--;
    }
    if (c < 1 && n > 0) {
      c = 1;
      n--;
    }
    if (n > 0) {
      d++;
      n--;
    }
    if (n > 0) goto x;
    cout << "+------------------------+" << endl;
    cout << "|";
    for (int i = 1; i <= a; i++) cout << "O.";
    for (int i = 11 - a; i > 0; i--) cout << "#.";
    cout << "|D|)" << endl;
    cout << "|";
    for (int i = 1; i <= b; i++) cout << "O.";
    for (int i = 11 - b; i > 0; i--) cout << "#.";
    cout << "|.|" << endl;
    cout << "|";
    if (c == 1)
      cout << "O.";
    else if (c == 0)
      cout << "#.";
    for (int i = 11; i > 0; i--) cout << "..";
    cout << "|" << endl;
    cout << "|";
    for (int i = 1; i <= d; i++) cout << "O.";
    for (int i = 11 - d; i > 0; i--) cout << "#.";
    cout << "|.|)" << endl;
    cout << "+------------------------+" << endl;
  }
  return 0;
}
