Problem: Grisha come to a contest and faced the following problem.
You are given an array of size , initially consisting of zeros. The elements of the array are enumerated from to . You perform operations on the array. The -th operation is described with three integers , and (, ) and means that you should add to each of the elements with indices . After all operations you should find the maximum in the array.
Grisha is clever, so he solved the problem quickly.
However something went wrong inside his head and now he thinks of the following question: "consider we applied some subset of the operations to the array. What are the possible values of the maximum in the array?"
Help Grisha, find all integers between and such that if you apply some subset (possibly empty) of the operations, then the maximum in the array becomes equal to .
Input Format: The first line contains two integers and () — the length of the array and the number of queries in the initial problem.
The following lines contain queries, one per line. The -th of these lines contains three integers , and (, ), denoting a query of adding to the segment from -th to -th elements of the array, inclusive.
Output Format: In the first line print the only integer , denoting the number of integers from to , inclusive, that can be equal to the maximum in the array after applying some subset (possibly empty) of the given operations.
In the next line print these integers from to — the possible values of the maximum. Print these integers in increasing order.
Note: Consider the first example. If you consider the subset only of the first query, the maximum is equal to . If you take only the second query, the maximum equals to . If you take the first two queries, the maximum becomes . If you take only the fourth query, the maximum becomes . If you take the fourth query and something more, the maximum becomes greater that , so you shouldn't print it.
In the second example you can take the first query to obtain . You can take only the second query to obtain . You can take all queries to obtain .
In the third example you can obtain the following maximums:
- You can achieve the maximim of by using queries: .
- You can achieve the maximim of by using queries: .
- You can achieve the maximim of by using queries: .
- You can achieve the maximim of by using queries: .
- You can achieve the maximim of by using queries: .
- You can achieve the maximim of by using queries: .