Training Site
Sideways banner 8b44c02b768aa359c4d0a2bce3b247c6d7ab888f8b26852e9bfc3659c8c25612

Ducks in a Row

Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 128 megabytes
Time limit: 1.1 seconds

Ducks come in many different shapes and sizes.

In fact, they come in three different sizes: small (S), medium (M), and large (L).

As we all know, before a contest you should always have your ducks in a row. However, because you might have different sized ducks, you might need multiple rows - one for each size. To make sure you can see all of your ducks, you should have the largest ducks at the back and the smallest at the front. Additionally, each row should be centered relative to the longest row. If it's not possible to center a row perfectly, then the row can have more ducks on the left side, but it should still be as close to centered as possible.

Get quacking! The contest has started!

Input

There will be three lines, containing the numbers N_S, N_M, N_L (number of small, medium, and large ducks) respectively.

  • 0 \leq N_S, N_M, N_L \leq 1000.
  • There will always be at least one duck.

Output

Output three lines, one for each row. Use the characters S, M, and L to represent small, medium, and large ducks respectively, and use an underscore _ to represent an empty space.

  • The first line should be the furthest back row, which contains all the large ducks.
  • The second line should be the middle row, which contains all the medium ducks.
  • The third line should be the furthest forward row, which contains all the small ducks.

The row with the most ducks shouldn't have any empty spaces, and every line should have the same number of characters. For the purposes of this problem, we assume that every duck (regardless of size) takes up the same width.

Subtasks

  • Subtask 1 (+40%): N_S=0 and N_M=0 (in other words, there are only large ducks). Note that only Sample Input 3 is from this subtask.
  • Subtask 2 (+60%): No further constaints apply.
  • Sample Input 1

    7
    9
    5
    

    Sample Output 1

    __LLLLL__
    MMMMMMMMM
    _SSSSSSS_
    
  • Sample Input 2

    6
    5
    0
    

    Sample Output 2

    ______
    MMMMM_
    SSSSSS
    
  • Sample Input 3

    0
    0
    3
    

    Sample Output 3

    LLL
    ___
    ___