#P326. 练55.1 合影效果
练55.1 合影效果
Description
Xiaoming and his friends went to climb Xiangshan Mountain and were captivated by the beautiful scenery, wanting to take a group photo. If they stand in a row, with all boys on the left (from the photographer's perspective) arranged from shortest to tallest, and all girls on the right arranged from tallest to shortest, what would the photo look like (all heights are different)?
Input Format
The first line contains the number of people (, with at least boy and girl).
The next lines each contain a person's gender (male or female) and height (a floating-point number between and meters), separated by a space.
Output Format
Output floating-point numbers representing the heights of each person from left to right in the photographer's view after they line up. Each number should be rounded to decimal places, separated by a single space.
Sample
6
male 1.72
male 1.78
female 1.61
male 1.65
female 1.70
female 1.561.65 1.72 1.78 1.70 1.61 1.56