Олимпиадный тренинг

Задача 38462. Cake sets


In the warehouse of the confectionery factory, two types of cakes are stored - croissants and eclairs. Croissants are A pieces and eclairs are B pieces. There is an unlimited supply of gift boxes, each box can only contain three cakes. This requires that the box contains both types of cakes, that is, one box can contain two croissants and one eclair or one croissant and two eclairs.
Determine if it is possible to pack all available cakes into boxes and output a suitable way for placing cakes in boxes.


Input
The program receives as input two integers A and B written on separate lines. 1 <= A <= 109, 1 <= B <= 109.

Imprint
If it is possible to arrange all the cakes into boxes in accordance with the condition of the problem, the program should output two integers. The first number is equal to the number of boxes that contain two croissants and one eclair. The second number is equal to the number of boxes that contain one croissant and two eclairs. 
If it is impossible to put all the cakes into boxes in the right way, the program should output a single number -1.
 
Examples
# Input Output
1 4
5
1 2
2 5
3
-1