Magical Runes

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

You maintain a very nice collection of magical runes. They generally come in two types, type A and type B.

You have arranged your runes on a shelf to show them off. Because they are magical runes, they change each day. That is, at the start of each day the leftmost rune will switch its type (i.e. from A to B or from B to A, depending on its type just before the start of the day). Every other rune will only change if the type of the rune to its left changes from B to A.

For example, if you have three runes initially arranged like ABBAA, then at the start of the next day only the leftmost rune will change and the sequence will look like BBBAA. After another day, the leftmost rune will change, but then the second rune from the left will change because the rune beside it changed from B to A. But then the third rune will also change for the same reason. And then the fourth rune will also change! That is, after the changes at the start of this day the runes will look like AAABA.

Your task is the following. Given the initial states SS of an initial arrangement of runes and given a number of days 𝐷D, you should determine the states of the runes after DD days have elapsed.

입력

Input consists of a single line that first begins with a string SS followed by an integer DD. The length of SS will be between 11 and 3030 (inclusive) and SS will consist only of characters A and B. The value DD satisfies 0D<2300≤D<2^{30}.

Finally, you are also guaranteed that the rightmost rune does not change from B to A at the start of any of the DD days that you are to consider.

출력

Display a single string showing the states of the runes after DD days have elapsed, given they started in state SS.