Gwen's Gift
문제
Gwen loves most numbers. In fact, she loves every number that is not a multiple of (she really hates the number ). For her friends' birthdays this year, Gwen has decided to draw each of them a sequence of flowers. Each of the flowers will contain between and flower petals (inclusive). Because of her hatred of multiples of , the total number of petals in any non-empty contiguous subsequence of flowers cannot be a multiple of . For example, if , then the top two paintings are valid, while the bottom painting is not valid since the second, third and fourth flowers have a total of petals. (The top two images are Sample Input and .)
Gwen wants her paintings to be unique, so no two paintings will have the same sequence of flowers. To keep track of this, Gwen recorded each painting as a sequence of numbers specifying the number of petals in each flower from left to right. She has written down all valid sequences of length in lexicographical order. A sequence is lexicographically smaller than if there exists an index such that for and .
What is the th sequence on Gwen's list?
입력
The input consists of a single line containing two integers (), which is Gwen's hated number, and (), which is the index of the valid sequence in question if all valid sequences were ordered lexicographically. It is guaranteed that there exist at least valid sequences for this value of .
출력
Display the th sequence on Gwen's list.
예제
예제 1
4 3
2 1 2
예제 2
2 1
1
예제 3
5 22
4 3 4 2
예제 4
5 16
3 3 3 3