#abc100d. [abc100_d]Patisserie ABC
[abc100_d]Patisserie ABC
Problem Statement
Takahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 100.
The shop sells kinds of cakes.
Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The -th kind of cake has the beauty of , the tastiness of and the popularity of .
These values may be zero or negative.
Ringo has decided to have pieces of cakes here. He will choose the set of cakes as follows:
- Do not have two or more pieces of the same kind of cake.
- Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity).
Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
Constraints
- is an integer between and (inclusive).
- is an integer between and (inclusive).
- are integers between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
Sample Input 1
Sample Output 1
Consider having the -nd, -th and -th kinds of cakes. The total beauty, tastiness and popularity will be as follows:
- Beauty:
- Tastiness:
- Popularity:
The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is . This is the maximum value.
Sample Input 2
Sample Output 2
Consider having the -st, -rd and -th kinds of cakes. The total beauty, tastiness and popularity will be as follows:
- Beauty:
- Tastiness:
- Popularity:
The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is . This is the maximum value.
Sample Input 3
Sample Output 3
If we have the -rd, -th, -th, -th and -th kinds of cakes, the total beauty, tastiness and popularity will be , and , respectively.
The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is . This is the maximum value.
Sample Input 4
Sample Output 4
The values of the beauty, tastiness and popularity of the cakes and the value to be printed may not fit into 32-bit integers.