In a certain advertising agency (referred to as AA), there is a need for a program that, based on the daily list of printer job requests, determines – the maximum profit the printer can achieve on that day.
Each job request is characterized by four integers: - the time the order is received (0 \le B \le 10, with all times measured in hours from the opening of the AA), - the time required to complete the order (1 \le L \le 10), - the deadline by which the order must be finished (0 \le F \le 10), and - the profit the AA earns if the order is completed (0 \le C \le 10000). The printer can handle only one request at a time, and once it starts a job, it must continue until the job is finished. Your task is to write a program that fulfills this requirement for the AA.
The first line contains the number of requests (1 \le N \le 1000). The next lines provide the details of each request, specified by the numbers , , , and .
Output the maximum profit that the printer can achieve.
Example 1