\documentclass{article}
\input{preamble}
\title{Binary Beauty - MathGames}

\begin{document}

\maketitle
{\bf Difficulty:} \stars{3}\\
{\bf Key words: Combinatorics} \\

Due to some unfortunate events with a curling iron, Rapunzel has once again lost most of her hair, having ``only'' $1$ metre left. Of course, she would like her locks back as soon as possible and thus she has turned to some dubious hair products. One of the products will add $1$ metre to her hair overnight, while the other will double her hair length overnight. She can only use one product each day, and would like to get her hair back \textit{precisely} to its original length as soon as possible. Can you help her out?
\vspace{0.5cm}

{\Large \textbf Input}
\begin{itemize}
    \item A single integer $2 \leq n < 10^{100}$, Rapunzel's target hair length in metres. % integer parse limit in python is 4300 characters
\end{itemize}

{\Large \textbf Output}
\begin{itemize}
    \item On the first line a single integer $m$, the minimal number of days for Rapunzel to get her hair back.
    \item Next, $m$ lines of which the $i^{\textnormal{th}}$ is either \texttt{ADD} or \texttt{DOUBLE}, depending on the hair product which Rapunzel should use on the $i^{\textnormal{th}}$ day to get to her target length of $n$. If there are multiple valid answers, you may print any one of them.
\end{itemize}
%print(n.bit_length() + n.bit_count() - 2)

{\Large \textbf Examples}\\
\begin{center}
\scalebox{1.5}{
\begin{tabular}{|l|l|}
\hline
Input & Output \\ \hline
2 & 1\\
& ADD\\\hline
\end{tabular}
}

\vspace{1em}

\scalebox{1.5}{
\begin{tabular}{|l|l|}
\hline
Input & Output \\ \hline
5 & 3\\
&ADD\\
&DOUBLE\\
&ADD\\\hline
\end{tabular}
}
\end{center}


\end{document}