eolymp
bolt
Try our new interface for solving problems
Problems

Fibonacci strings generation

Fibonacci strings generation

Generate $n$-th Fibonacci string that is defined with the next recurrent formula: \begin{itemize} \item $f(0) = "a"$; \item $f(1) = "b"$; \item $f(n) = f(n - 1) + f(n - 2)$, where $"+"$ operation means concatenation \end{itemize} For example, $f(3) = f(2) + f(1) = (f(1) + f(0)) + f(1) = "b" + "a" + "b" = "bab"$. \InputFile One integer $n~(0 \le n \le 20)$. \OutputFile Print the $n$-th Fibonacci string.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
Output example #1
bab
Input example #2
5
Output example #2
babbabab
Author Mykhailo Medvediev