eolymp
bolt
Try our new interface for solving problems
Problems

Fibonacci String

Fibonacci String

The Fibonacci strings are defined as follows: \begin{itemize} \item The first Fibonacci string is "\textbf{a}" \item The second Fibonacci string is "\textbf{bc}" \item The (\textbf{n + 2})nd Fibonacci string is the concatenation of the two previous Fibonacci strings. \end{itemize} For example, the first few Fibonacci strings are \begin{verbatim} abcabcbcabcabcbcabc\end{verbatim}The goal is, given a row and an offset, to determine what character is at that offset. \InputFile Two integers separated by a space - \textbf{K} and \textbf{P}(\textbf{0} < \textbf{K} ≤ \textbf{10^8}), (\textbf{0} < \textbf{P} ≤ \textbf{10^8}), where \textbf{K} is the line number of the Fibonacci string and \textbf{P} is the position number in a row. \OutputFile The desired character for the relevant test: "\textbf{a}", "\textbf{b}" or "\textbf{c}". If \textbf{P} is greater than the \textbf{K}th row (\textbf{K} ≤ \textbf{10^8}), it is necessary to derive "\textbf{No solution}".
Time limit 1 second
Memory limit 256 MiB
Input example #1
20 46
Output example #1
b