Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EI2121Q1M1 - A List of Staffs

Given a list of staff in a company. Each staff has a unique identity, name, and the start year.

Output the list of staff in order of descending the number of working years, then by ascending name and id.

Input

-      The first line contains one integer N - the number of staffs (1 £ N £ 105).

-      Each line in the next N lines includes information about a staff:

  • Id: 6-digit integer
  • Name: a string contains lower alphanumeric characters only
  • Start year: an integer.

Output

The list is in the required order. Each line contains id, name, and the number of working years of corresponding staff. Note that the current year in the context is 2021

 

Sample

Input

Output

5

100004 tan 2000

100001 phuc 2000

100002 nam 1999

100003 phuc 2000

100005 an 2006

100002 nam 22

100001 phuc 21

100003 phuc 21

100004 tan 21

100005 an 15

 


Added by:Ha Minh Ngoc
Date:2021-11-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.