{"raw_statement":[{"iden":"problem statement","content":"There are $N$ creatures standing in a circle, called Snuke $1, 2, ..., N$ in counter-clockwise order.\nWhen Snuke $i$ $(1 \\leq i \\leq N)$ receives a gem at time $t$, $S_i$ units of time later, it will hand that gem to Snuke $i+1$ at time $t+S_i$. Here, Snuke $N+1$ is Snuke $1$.\nAdditionally, Takahashi will hand a gem to Snuke $i$ at time $T_i$.\nFor each $i$ $(1 \\leq i \\leq N)$, find the time when Snuke $i$ receives a gem for the first time. Assume that it takes a negligible time to hand a gem."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 200000$\n*   $1 \\leq S_i,T_i \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S_1$ $S_2$ $\\ldots$ $S_N$\n$T_1$ $T_2$ $\\ldots$ $T_N$"},{"iden":"sample input 1","content":"3\n4 1 5\n3 10 100"},{"iden":"sample output 1","content":"3\n7\n8\n\nWe will list the three Snuke's and Takahashi's actions up to time $13$ in chronological order.\nTime $3$: Takahashi hands a gem to Snuke $1$.\nTime $7$: Snuke $1$ hands a gem to Snuke $2$.\nTime $8$: Snuke $2$ hands a gem to Snuke $3$.\nTime $10$: Takahashi hands a gem to Snuke $2$.\nTime $11$: Snuke $2$ hands a gem to Snuke $3$.\nTime $13$: Snuke $3$ hands a gem to Snuke $1$.\nAfter that, they will continue handing gems, though it will be irrelevant to the answer."},{"iden":"sample input 2","content":"4\n100 100 100 100\n1 1 1 1"},{"iden":"sample output 2","content":"1\n1\n1\n1\n\nNote that the values $S_i$ and $T_i$ may not be distinct."},{"iden":"sample input 3","content":"4\n1 2 3 4\n1 2 4 7"},{"iden":"sample output 3","content":"1\n2\n4\n7\n\nNote that a Snuke may perform multiple transactions simultaneously. Particularly, a Snuke may receive gems simultaneously from Takahashi and another Snuke."},{"iden":"sample input 4","content":"8\n84 87 78 16 94 36 87 93\n50 22 63 28 91 60 64 27"},{"iden":"sample output 4","content":"50\n22\n63\n28\n44\n60\n64\n27"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}