Pair Recovery

4.1

17 votes
Mathematics, Very-Easy, Mathematics, Mathamatics
Problem

You once had a pair of integers (a1,a2). You decided to have fun by adding a few next numbers, creating a sequence. The initial sequence is just (a1,a2), then every new number is the sum of the previous two. For example, if a sequence is (10,20), a new number will be 10+20=30. Then the sequence is (10,20,30) and a new number will be 20+30=50, and so on.

One day, you woke up only to find out that you had forgotten the initial pair (a1,a2). Luckily, you happen to still remember values a3 and a4.

Given a3 and a4, determine a1 and a2.

Input

The first and only line contains two space-separated integers a3 and a4.

Output

Print two space-separated integers a1 and a2.
Please note that these numbers could be negative.

It can be proven that, under the given constraints, the answer always exists and is unique.

Constraints

1a3,a4106

In tests worth 60 points in total, a3,a41000.

Note that the expected output feature for custom input is disabled for this contest. 

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In the sample test, we are given a3=30 and a4=50. As explained in the statement, the initial pair (10,20) produces a sequence (10,20,30,50,), so we should print a pair 10 20.

Editor Image

?