#include <bits/stdc++.h>
using namespace std;
bool ar[4][100];
int main() {
  int k;
  cin >> k;
  int y = 0;
  while (k > 0 && y < 4) {
    ar[y][0] = true;
    y++;
    k--;
  }
  for (int i = 0; i < k; i++) {
    int z = i % 3;
    if (z == 2) z = 3;
    ar[z][int(i / 3) + 1] = true;
  }
  cout << "+------------------------+" << endl;
  for (int i = 0; i < 4; i++) {
    cout << "|";
    for (int j = 0; j < 11; j++) {
      if (j == 0) {
        if (ar[i][j])
          cout << "O.";
        else
          cout << "#.";
      } else {
        if (ar[i][j])
          cout << "O.";
        else if (i != 2)
          cout << "#.";
        else
          cout << "..";
      }
    }
    if (i == 0)
      cout << "|D";
    else if (i == 2)
      cout << "..";
    else
      cout << "|.";
    cout << "|";
    if (i == 0 || i == 3) cout << ")";
    cout << endl;
  }
  cout << "+------------------------+" << endl;
}
