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 a1,a2,...,an, then after we apply the described operation, the sequence transforms into a1,a2,...,an[,a1,a2,...,al] (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.
Output
Print the elements that Sereja is interested in, in the order in which their numbers occur in the input.
Examples
Output
1 2 1 2 3 1 2 1 2 3 1 2 1 2 3 4