Under construction

Still being built. Things may change

Rice Cakes for the Tiger

Interview

Time limit1sMemory limit128 MB

Summary
Given the day index D and Fibonacci-like combination coefficients, find starting values A and B (A ≤ B) so the D-th term equals K.
Level

Easy3 of 10

Topics
Math, Brute force, Simulation
Solved
No attempts yet

Problem

A grandmother crosses a mountain once every day. On the mountain path, a tiger lets her pass only if it receives as many rice cakes as the sum of the amounts it received yesterday and the day before yesterday.

If she gives A rice cakes on the first day and B rice cakes on the second day, then from the third day onward the amount for each day is the sum of the previous two days. The third day is A+B rice cakes, and the fourth day is A+2B rice cakes.

You are told that on the D-th day since the grandmother first met the tiger, she gave K rice cakes. Find A, the number of rice cakes given on the first day, and B, the number given on the second day. An integer answer with 1 ≤ A ≤ B always exists. If there are multiple possible answers, output any one of them.

Input

The first line contains two integers D and K separated by a space.

D is the number of days since the grandmother first gave rice cakes to the tiger, and K is the number of rice cakes given on day D. The constraints are 3 ≤ D ≤ 30 and 10 ≤ K ≤ 100,000.

Output

Print A, the number of rice cakes given on the first day, on the first line.

Print B, the number of rice cakes given on the second day, on the second line.

Examples2

  1. Example 1

    Input
    6 41
    
    Expected output
    2
    7
    
  2. Example 2

    Input
    7 218
    
    Expected output
    10
    21