Disposable Cup

Given A, B, and N, find every total height achievable by stacking N cups, where same-facing neighbors add A and opposite-facing ones add A+B.

Medium4CombinatoricsMathNo attempts yetTime limit1sMemory limit32 MB

Problem

Chanwoo stacks NN paper cups into one tower. He thinks a triangle is too hard to build, so the tower runs straight up and down. A single cup has the shape below.

One cup is A+BA + B tall. When a cup is nested onto a cup that faces the same way, the upper cup sinks BB into the lower one, so the tower grows by only AA. Two neighbouring cups that face opposite ways meet rim to rim or base to base and do not nest, so the two parts simply add their heights.

Six cups stacked in the pattern )(())) look like this.

With A=8A = 8 and B=36B = 36, that tower is 156mm tall.

Chanwoo can choose the direction of every cup. Write a program that finds every tower height Chanwoo can build with NN cups.

Input

The first line contains AA, BB, and NN separated by spaces. (1A,B,N10001 \le A, B, N \le 1\,000, 2AB2A \le B)

Output

Print every achievable tower height in ascending order on one line, separated by spaces.