LearnPy Hub
← Arena
EasyRating 900

Boys and Girls

Every second, each boy (B) standing directly in front of a girl (G) swaps places with her. Print the queue after t seconds.

Input

n t, then the queue.

Output

The queue.

Sample 1

Input
5 1
BGGBG
Output
GBGGB

Sample 2

Input
5 2
BGGBG
Output
GGBGB
solution.py
Output appears here
Boys and Girls · Python Arena problem · LearnPy Hub