{"raw_statement":[{"iden":"problem statement","content":"AtCoder Inc. sells [glasses](https://suzuri.jp/AtCoder/5510290/water-glass/m/clear) and [mugs](https://suzuri.jp/AtCoder/5510290/mug/m/white).\nTakahashi has a glass with a capacity of $G$ milliliters and a mug with a capacity of $M$ milliliters.  \nHere, $G<M$.\nInitially, both the glass and the mug are empty.  \nAfter performing the following operation $K$ times, determine how many milliliters of water are in the glass and the mug, respectively.\n\n*   When the glass is filled with water, that is, the glass contains exactly $G$ milliliters of water, discard all the water from the glass.\n*   Otherwise, if the mug is empty, fill the mug with water.\n*   Otherwise, transfer water from the mug to the glass until the mug is empty or the glass is filled with water."},{"iden":"constraints","content":"*   $1\\leq K\\leq 100$\n*   $1\\leq G<M\\leq 1000$\n*   $G$, $M$, and $K$ are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$K$ $G$ $M$"},{"iden":"sample input 1","content":"5 300 500"},{"iden":"sample output 1","content":"200 500\n\nThe operation will be performed as follows. Initially, both the glass and the mug are empty.\n\n*   Fill the mug with water. The glass has $0$ milliliters, and the mug has $500$ milliliters of water.\n*   Transfer water from the mug to the glass until the glass is filled. The glass has $300$ milliliters, and the mug has $200$ milliliters of water.\n*   Discard all the water from the glass. The glass has $0$ milliliters, and the mug has $200$ milliliters of water.\n*   Transfer water from the mug to the glass until the mug is empty. The glass has $200$ milliliters, and the mug has $0$ milliliters of water.\n*   Fill the mug with water. The glass has $200$ milliliters, and the mug has $500$ milliliters of water.\n\nThus, after five operations, the glass has $200$ milliliters, and the mug has $500$ milliliters of water. Hence, print $200$ and $500$ in this order, separated by a space."},{"iden":"sample input 2","content":"5 100 200"},{"iden":"sample output 2","content":"0 0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}