Olympic Games

No attempts yetTime limit2sMemory limit256 MB

Problem

Sanggeun both loves and hates the Olympics. He loves them because he gets to watch many different sporting events, and he hates them because several events run at the same time, so he cannot watch all of them live.

He has just arrived at the Olympic venues. Given the date, start time, and end time of every event, determine the maximum number of events Sanggeun can watch live.

The rules are as follows.

  • Sanggeun enters a venue at an event's start time and leaves at its end time.
  • While watching one event he cannot move to another venue in the middle of it.
  • Moving between venues takes no time. Therefore, if one event's end time equals another event's start time, he can finish the first event and immediately move on to the next one.
  • Once an event has already started, he can no longer enter that venue.

Input

The first line contains the number of test cases nn.

The first line of each test case contains the number of events mm (1m500001 \le m \le 50000). Each of the next mm lines contains three integers dd, ss, and ee describing one event, where dd is the date the event is held, ss is its start time, and ee is its end time. Times are given in hhmm format, and every event ends on the day it starts.

Output

For each test case, first print Scenario #i:, where ii is the test case number starting from 1. On the next line, print the maximum number of events Sanggeun can watch. Print one blank line between the outputs of consecutive test cases.