Page not loading? Try clicking here.
Placeholder

#1001

Dogs and Chicks 1s 32MB

Problems

Write a program that takes the sum of puppies and chicks and the number of legs as input and calculates how many puppies and chicks there are.


Input

Non-negative integers less than or equal to the sum of puppies and chicks and less than or equal to 1,000 and the sum of legs less than or equal to 4,000 are entered separated by spaces.

Even after one result is produced, new inputs are continuously received and the program ends when 0 0 is input.


Output

Print out the number of puppies and chicks, separated by a space.

If the number of animals cannot be determined with the given data, “0” is output.

If the data size is outside the given range, “INPUT ERROR!” is output.


Example

25 80

15 10
1500 20000
0 0
15 10

0
INPUT ERROR!


Source

JUNGOL

You must sign in to write code.