You have coins, and you must make stock transactions. Each transaction involves buying or selling a share. All shares are worth one coin each. You can only buy if you have a coin, and can only sell if you have a share.
Given and , print all possible sequences of operations.
Input consists of and . Suppose .
Print in alphabetical order all possible sequences of
operations when we start with
coins. Use ‘b’ to buy and ‘s’ to sell.
Input
4 1
Output
bsbs
Input
7 3
Output
bbbsbsb bbbsbss bbbssbb bbbssbs bbbsssb bbsbbsb bbsbbss bbsbsbb bbsbsbs bbsbssb bbssbbb bbssbbs bbssbsb bsbbbsb bsbbbss bsbbsbb bsbbsbs bsbbssb bsbsbbb bsbsbbs bsbsbsb