Since many of the advertisements want some of the same floors as others, it is often impossible to choose all of them. Can you help choosing which of the orders to accept so that the above constraints are fulfilled and the amount of profit is maximized?
The first line of input will contain T (≤ 50) denoting the number of cases.
Each case starts with an integer N (1 ≤ N ≤ 30000) denoting the number of advertisement orders. Each of the next N lines represents an advertisement by three integers A (0 ≤ A ≤ 10^5), B (1 ≤ B ≤ 10^5) and C (1 ≤ C ≤ 1000) denoting the lowest floor, the number of floors the advertisement covers (including the lowest floor) and the amount of money earned for placing it, respectively.
For each case, print the case number and the maximum profit they can achieve.