3937: Sales charts

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:5 解决:3

题目描述



Your task is to help the Taobao store manager to organize the sales data.


Sort all the items in descending order of sales according to the accumulated sales records.

输入

The input includes multiple rows of data (the number of rows is less than 100000).


Each row of data includes 4 pieces, which are the product name, sales quantity, unit price, and date.

The product name consists of lowercase letters and does not exceed 100 characters. 



The sales quantity and unit price are positive integers and less than 10000.


输出

The output includes multiple lines of data.


All the items appearing in the input are arranged in descending order of sales quantity.


Each line of includes three pieces: the product name, the sales quantity, and the sales amount. 


If the two items are the same quantity, then the goods are Alphabetical order in ascending order.

样例输入 复制

apple 1 20 2014-4-2 
basketball 1 20 2014-4-2
computer 1 20 2014-4-2
shoe 1 20 2014-4-2
tv 1 20 2014-4-2
apple 1 18 2014-4-3 

样例输出 复制

apple 2 38
basketball 1 20
computer 1 20
shoe 1 20
tv 1 20

提示

 

来源/分类