Ruthenia is a fascinating country with a unique monetary system! They use three types of coins: galleons, sickles, and knuts. One galleon is equivalent to seventeen sickles, and one sickle is equivalent to twenty-nine knuts. All monetary amounts, including prices and cash, are expressed in galleons, sickles, and knuts, where the number of sickles does not exceed , and the number of knuts does not exceed .
Today is a special day for Stepan as he has received his first scholarship. However, before he can celebrate, he must purchase essential items for his studies, such as a student backpack, an alarm clock, and a pillow.
How much money will Stepan have left after making all these purchases?
The first line contains the amount of money Stepan received, represented by three numbers: the number of galleons, sickles, and knuts, separated by spaces. Remember, the number of sickles does not exceed , and the number of knuts does not exceed .
The second line contains the number (0 \leq N \leq 100000), which is the number of items that need to be purchased. The following lines list the prices of each item in the same format as the first line. Each item costs at least one knut.
Data constraints: the number of galleons in each line does not exceed .
Output a single line indicating the amount of money Stepan has left after all purchases, in the same format as the first line of input. If Stepan does not have enough money, output the number .
Example 1