#include <bits/stdc++.h>
using namespace std;
int i, j, n;
char c[50][50] = {
    {"+------------------------+"},  {"|#.#.#.#.#.#.#.#.#.#.#.|D|)"},
    {"|#.#.#.#.#.#.#.#.#.#.#.|.|"},  {"|#.......................|"},
    {"|#.#.#.#.#.#.#.#.#.#.#.|.|)"}, {"+------------------------+"},
};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; n; i++)
    for (int j = 0; j < 6 && n; j++)
      if (c[j][i] == '#') c[j][i] = 'O', n--;
  for (int i = 0; i < 6; i++) cout << c[i] << endl;
  return 0;
}
