RemoveLst

You are given integers a, b and n. Consider the array lst[i] = a*i + b, 1 ≤ i ≤ n.

A removelst operation is defined as follows:

  1. Remove from the current array all the elements with an even index
  2. Obtain a new array with the remaining elements.
  3. Repeat the previous steps until the array contains only 2 elements.

Your task is to print the last 2 remaining elements.

Input

Three space-separated integers: a, b and n.

Output

The last 2 remaining elements, separated by space.

Constraints

  • 2 ≤ n ≤ 109
  • -1000 ≤ a, b ≤ 1000

Sample

InputOutputExplanation
3 2 55 17The array transformation looks like this:
  1. lst = [5, 8, 11, 14, 17]
  2. lst = [5, 11, 17]
  3. lst = [5, 17]
Questions?

Sponsors Gold