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.

EIUATTEND1 - Class Attendance

You are given an attendance list of a class. Suppose that there are some students attend all lessons, and every student joinned at least one lessons.

Your task is to write a program to print out student’s ID, the number of their absent days and attendant day.

Input

-          The first line contains an integer M – attendance list size (1 £ M £ 105).

-          Each line in the next M lines represents 3 integers: class’s start time (in milliseconds format), student ID and class ID followed by a boolean isCheckin (0 - absence or 1 - present) . All integers don’t exceed 1018.

Output

The required sorted list. Each line in the output contains student ID, the number of their absent days and the number of their attendant day. The list should be sorted in ascending order of student ID.

Sample

Input

Output

5

1656894600000 001 0001 1

1656894600000 002 0001 1

1657153800000 001 0001 1

1657499400000 001 0001 1

1657499400000 002 0001 0

001 0 3

002 2 1

 

 

*Note: there is always at least 1 student attending all lessons, and every student joinned at least one lessons.


Added by:Ha Minh Ngoc
Date:2022-08-29
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: GOSU
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.