Jon Snow and Daenerys Targaryen are playing a game to kill white-walkers. More white-walkers they kill, more power of Night King will be decreased. They need to destroy n white-walkers to decrease the certain level of strength of Night King. Jon's Dragon performs an attack with u hits per second of fire and Daenerys's Dragon performs an attack with v hits per second of fire. Each Dragon spends the fixed time to raise fire (Jon's Dragon spends 1/u seconds to fire and Daenerys Dragon spends 1/v seconds to fire). The ith white-walker dies after he receives ai hits of fire.
Jon and Daenerys wonder who makes the last hit on each white-walker. If Jon and Daenerys make the last hit at the same time, we assume that both of them have made the last hit.
Input:
Output:
In the sample test case Jon makes the first hit at time 1 / 3, Daenerys makes the second hit at time 1 / 2, Jon makes the third hit at time 2 / 3, and both make the fourth and fifth hit simultaneously at the time 1.