#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const double eps = 1e-9;
const double INF = inf;
const double EPS = eps;
char s[200][100] = {
    "+------------------------+",  "|O.O.O.O.O.O.O.O.O.O.O.|D|)",
    "|O.O.O.O.O.O.O.O.O.O.O.|.|",  "|O.......................|",
    "|O.O.O.O.O.O.O.O.O.O.O.|.|)", "+------------------------+"};
int main() {
  int n;
  scanf("%d", &n), n = 34 - n;
  for (int i = strlen(s[0]); i >= 0; i--)
    for (int j = 5; j >= 0; j--)
      if (n && s[j][i] == 'O') s[j][i] = '#', n--;
  for (int i = 0; i < 6; i++) puts(s[i]);
  ;
  return 0;
}
