CF380A Sereja and Prefixes
Description
Sereja loves number sequences very much. That's why he decided to make himself a new one following a certain algorithm.
Sereja takes a blank piece of paper. Then he starts writing out the sequence in $ m $ stages. Each time he either adds a new number to the end of the sequence or takes $ l $ first elements of the current sequence and adds them $ c $ times to the end. More formally, if we represent the current sequence as $ a_{1},a_{2},...,a_{n} $ , then after we apply the described operation, the sequence transforms into $ a_{1},a_{2},...,a_{n}[,a_{1},a_{2},...,a_{l}] $ (the block in the square brackets must be repeated $ c $ times).
A day has passed and Sereja has completed the sequence. He wonders what are the values of some of its elements. Help Sereja.
Input Format
The first line contains integer $ m $ $ (1
Output Format
Print the elements that Sereja is interested in, in the order in which their numbers occur in the input.