INTEGER7 - Integers

no tags 

Find two nonnegative integers x1 and x2 so that a1 * x1 + b1 = a2 * x2 + b2 and x1 + x2 is minimized. Given that there exist x1 and x2 satisfying the above equation.

Input

  • A single line containing four integers a1, b1, a2, b2 (the integers are within the interval [0..231-1].

Output

  • Print two integers x1, x2.

Example

Input
3 4 5 5

Output
2 1


Added by:Nguyen Minh Hieu
Date:2008-07-05
Time limit:0.980s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS NODEJS PERL 6 VB.net
Resource:VNOI Marathon '08 - Round 4
Problem Setter: Nguyễn Minh Hiếu