#include <bits/stdc++.h>
#pragma warning(disable : 4786)
#pragma warning(disable : 4996)
using namespace std;
char bus[100][100] = {
    "+------------------------+",  "|#.#.#.#.#.#.#.#.#.#.#.|D|)",
    "|#.#.#.#.#.#.#.#.#.#.#.|.|",  "|#.......................|",
    "|#.#.#.#.#.#.#.#.#.#.#.|.|)", "+------------------------+"};
int main() {
  int k;
  scanf("%d", &k);
  for (int i = 0; i < 50; i++)
    for (int j = 0; j < 6; j++)
      if (bus[j][i] == '#' && k) {
        bus[j][i] = 'O';
        k--;
      }
  for (int i = 0; i < 6; i++) printf("%s\n", bus[i]);
  return 0;
}
