#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, counter = 0;
  char arr[4][22];
  cin >> num;
  cout << "+------------------------+" << endl;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 22; j++) {
      if (j == 0) arr[i][j] = '#';
      if (i != 2) {
        if (j % 2 == 0) {
          arr[i][j] = '#';
        } else if (j % 2 != 0)
          arr[i][j] = '.';
      } else if (arr[i][j] != '#')
        arr[i][j] = '.';
    }
  }
  for (int j = 0; j < 22; j++) {
    for (int i = 0; i < 4; i++) {
      if (num != 0) {
        if (arr[i][j] == '#') {
          arr[i][j] = 'O';
          num--;
        }
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << "|";
    for (int j = 0; j < 22; j++) {
      cout << arr[i][j];
    }
    if (i == 0) cout << "|D|)" << endl;
    if (i == 1) cout << "|.|" << endl;
    if (i == 2) cout << "..|" << endl;
    if (i == 3) cout << "|.|)" << endl;
  }
  cout << "+------------------------+";
  return 0;
}
