## INTEGER7 - Integers

English | Vietnamese |

Find two nonnegative integers x1 and x2 so that a_{1} * x_{1} + b_{1} = a_{2} * x_{2} + b_{2} and x_{1} + x_{2} is minimized. Given that there exist x_{1} and x_{2} satisfying the above equation.

### Input

- A single line containing four integers a
_{1}, b_{1}, a_{2}, b_{2}(the integers are within the interval [0..2^{31}-1].

### Output

- Print two integers x
_{1}, x_{2}.

### Example

Input3 4 5 5Output2 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 |