#C2161. Organize the Bookshelf

    ID: 45447 Type: Default 1000ms 256MiB

Organize the Bookshelf

Organize the Bookshelf

You are given a bookshelf represented by a string consisting only of the characters F, N, and R. These characters represent three different genres of books. Your task is to rearrange the books such that all the F books come first, followed by all the N books, and finally the R books.

The input starts with an integer T representing the number of test cases. Each subsequent line corresponds to a test case containing a string. For each test case, you should output the rearranged bookshelf string on a new line.

Note: Make sure to process the input from stdin and output the result to stdout.

inputFormat

The input is read from stdin and is formatted as follows:

  1. An integer T representing the number of test cases.
  2. T lines follow, each containing a string composed only of the characters F, N, and R.

outputFormat

For each test case, output a single line containing the rearranged string: all the F characters first, followed by all the N characters, and then all the R characters.

## sample
1
FNRRFN
FFNNRR

</p>