#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 nn (2n402≤n≤40, with at least 11 boy and 11 girl).
The next nn lines each contain a person's gender (male or female) and height (a floating-point number between 00 and 22 meters), separated by a space.

Output Format

Output nn 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 22 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.56
1.65 1.72 1.78 1.70 1.61 1.56