Under construction

Still being built. Things may change

Onion Experiment

Time limit1sMemory limit1024 MB

Summary
Simulate N days of two onions: praise adds A, criticism adds B, roles swap when the criticized onion is longer, and a tie cuts it by 1. Print both lengths.
Level

Easy2 of 10

Topics
Simulation, Implementation
Solved
No attempts yet

Problem

Younghyun wants to teach his students a lesson with an 'onion experiment'. The onion experiment compares how fast onions grow when they receive praise versus criticism.

He expected the 'praised onion' to grow faster than the 'criticized onion'. However, the 'criticized onion' grew faster after being moved by the students' diss rap.

Younghyun reluctantly decided to manipulate the experiment and carried it out as follows.

The first length of both onions is 11. Give one onion the role of 'praised onion' and the other the role of 'criticized onion'.

  1. Every day, students praise the 'praised onion' and criticize the 'criticized onion'. Praising an onion makes it grow by AA, and criticizing an onion makes it grow by BB. (Here, A<BA < B)
  2. Check the onions. If the 'criticized onion' is longer than the 'praised onion', swap their roles.
  3. If the two onions have the same length, cut the 'criticized onion' by 11.

Each day, steps 1, 2, and 3 are carried out in this order during the experiment.

Print the result of the experiment after NN days.

Input

The first line contains the number of days NN the experiment runs, the growth AA from praising an onion, and the growth BB from criticizing an onion. (1≤N≤100,1≤A<B≤101 ≤ N ≤ 100, 1 ≤ A < B ≤ 10, and N,A,BN, A, B are all integers.)

Output

When the experiment ends, print the length of the 'praised onion' and the length of the 'criticized onion', in that order.

Examples3

  1. Example 1

    Input
    10 3 5
    
    Expected output
    41 40
    
  2. Example 2

    Input
    1 5 6
    
    Expected output
    7 6
    
  3. Example 3

    Input
    2 5 6
    
    Expected output
    12 11