#C2769. Sorting Photo Effects
Sorting Photo Effects
Sorting Photo Effects
You are given a list of photo effects, each being one of Sepia, B&W, or Color. Your task is to sort the photo effects in the following fixed order:
- Sepia comes first,
- followed by B&W,
- and finally Color.
The input is read from the standard input (stdin
) and the sorted list should be printed to the standard output (stdout
). For example, given 5 photo effects "Sepia B&W Color Sepia Color", the output should be "Sepia Sepia B&W Color Color".
Note: There is no need to sort alphabetically, just group the effects in the specified order.
inputFormat
The first line of the input contains an integer \( n \) representing the number of photos. The second line contains \( n \) space-separated strings. Each string is either "Sepia", "B&W", or "Color".
outputFormat
Output a single line with the sorted photo effects in the order: all "Sepia" effects first, followed by all "B&W" effects, and then all "Color" effects. The effects should be separated by a single space.
## sample5
Sepia B&W Color Sepia Color
Sepia Sepia B&W Color Color