#D2336. Sorting Tuples
Sorting Tuples
Sorting Tuples
Write a program which reads items and sorts them. Each item has attributes and they are represented by \\{ integer, integer, upper-case letter, integer, string \\} respectively. Sort the items based on the following priorities.
- first by value (ascending)
- in case of a tie, by weight (ascending)
- in case of a tie, by type (ascending in lexicographic order)
- in case of a tie, by date (ascending)
- in case of a tie, by name (ascending in lexicographic order)
Constraints
- is a upper-case letter
- size of
- if
Input
The input is given in the following format.
: $v_{n-1} \; w_{n-1} \; t_{n-1} \; d_{n-1} \; s_{n-1}$
In the first line, the number of items . In the following lines, attributes of each item are given. represent value, weight, type, date and name of the -th item respectively.
Output
Print attributes of each item in order. Print an item in a line and adjacency attributes should be separated by a single space.
Example
Input
5 105 24 C 1500000000000 white 100 23 C 1500000000000 blue 105 23 A 1480000000000 pink 110 25 B 1500000000000 black 110 20 A 1300000000000 gree
Output
100 23 C 1500000000000 blue 105 23 A 1480000000000 pink 105 24 C 1500000000000 white 110 20 A 1300000000000 gree 110 25 B 1500000000000 black
inputFormat
Input
The input is given in the following format.
: $v_{n-1} \; w_{n-1} \; t_{n-1} \; d_{n-1} \; s_{n-1}$
In the first line, the number of items . In the following lines, attributes of each item are given. represent value, weight, type, date and name of the -th item respectively.
outputFormat
Output
Print attributes of each item in order. Print an item in a line and adjacency attributes should be separated by a single space.
Example
Input
5 105 24 C 1500000000000 white 100 23 C 1500000000000 blue 105 23 A 1480000000000 pink 110 25 B 1500000000000 black 110 20 A 1300000000000 gree
Output
100 23 C 1500000000000 blue 105 23 A 1480000000000 pink 105 24 C 1500000000000 white 110 20 A 1300000000000 gree 110 25 B 1500000000000 black
样例
5
105 24 C 1500000000000 white
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
110 25 B 1500000000000 black
110 20 A 1300000000000 gree
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
105 24 C 1500000000000 white
110 20 A 1300000000000 gree
110 25 B 1500000000000 black
</p>