Powerful Number

easy
1. You are given three numbers A, B, and X.
2. You have to print all-powerful numbers that have value less than or equal to X.
3. A number is powerful if it is equal to x^i + y^j for i >= 0 and j >= 0.

Input Format

Three numbers A, B, and X.

Output Format

Space-separated integers representing powerful numbers.

Constraints

1 <= A,B <= 100
1 <= X <= 10^6

Example

Input

        
Output

        
Previous
Quadruplet Sum - 2
Next
First Non-repeating Character

Related Questions