Promotion Counting#10592

Promotion Counting

1 second
128 megabytes
Very easy

Bessie the cow is helping Farmer John run the USA Cow Olympiad (USACO), an online contest in which participants answer challenging questions to demonstrate their mastery of bovine trivia.

To accommodate participants with a wider range of skill levels, Farmer John recently expanded the contest to include four divisions of increasing difficulty: bronze, silver, gold, and platinum. All new participants start in the bronze division, and whenever a participant achieves a perfect score in a contest, they are promoted to the next higher division. It is even possible for a participant to be promoted multiple times during the same contest. Farmer John keeps track of all contest participants and their current divisions so that he can start everyone at the appropriate level whenever he holds a contest.

When publishing the results of his most recent contest, Farmer John wants to include the number of participants who were promoted from bronze to silver, from silver to gold, and from gold to platinum. However, he neglected to record promotions as they occurred during the contest. Bessie, being the clever bovine that she is, realizes that Farmer John can deduce the number of promotions solely from the numbers of participants in each division before and after the contest. Please help her perform this computation!

Input

The input consists of four lines, each containing two integers in the range from to 10^6. The first line specifies the numbers of bronze participants before and after the contest. The second line specifies the numbers of silver participants before and after the contest. The third line specifies the numbers of gold participants before and after the contest. The last line specifies the numbers of platinum participants before and after the contest.

Output

Print three lines, each containing a single integer. The first line should contain the number of participants promoted from bronze to silver. The second line should contain the number of participants promoted from silver to gold. The third line should contain the number of participants promoted from gold to platinum.

Examples

In this example, participant was registered in each division before the contest. At the end of the contest, there were participants in both the bronze and platinum divisions. One possible way this could have happened is that new participants joined during the contest: one was promoted all the way to platinum, while the other remained in bronze.

Example 1

Loading
Loading