Time Limit : sec, Memory Limit : KB
English / Japanese  

Arithmetic and Geometric Germ

The two types of germs that Dr. Hideyo discovered, Arithmetic and Geometric Germ, have interesting properties regarding growth.

  • For Arithmetic Germ, the total number increases by a fixed number $d$ every hour. For example, if the initial total number is $a_0$, after one hour the total number increases to $a_1=a_0 + d$, after two hours the total number increases to $a_2=a_1 + d$, and so on.
  • For Geometric Germ, the total number increases by a constant factor $r$ every hour. For example, if the initial total number is $a_0$, after one hour the total number will be $a_1=a_0 \times r$, and after two hours the total number will be $a_2=a_1 \times r$.

Dr. Hideyo plans to use the germ he has on hand for his experiment nine hours from now, but he forgot which germ the sample he has on hand belongs to. However, he realized that by knowing the total number of germs after one hour and two hours, he could determine which one it was.

Given the initial total number of germs on hand and the total number of germs after one hour and two hours, create a program that outputs the total number of germs after nine hours. However, it is not given whether the germ at hand is Arithmetic Germ or Geometric Germ. Also, the hourly growth rate $d$ of Arithmetic Germ and the hourly growth rate $r$ of Geometric Germ are positive integers.

Input

The input is given in the following format.

$a_0$ $a_1$ $a_2$

One line gives the initial total number of germs on hand, $a_0$ ($1 \leq a_0 \leq 100$), the total number after one hour, $a_1$ ($a_0 < a_1 \leq 101$), and the total number after two hours, $a_2$ ($a_1 < a_2 \leq 102$) are given. Inputs that cannot be determined for either germ are not given.

Output

Output the total number of germs at hand after 9 hours on one line.

Sample Input and Output

Sample Input 1

2 6 10

Sample Output 1

38

In input example 1, the number of Arithmetic Germ growing every hour is 4. The answer is 14 after 3 hours, 18 after 4 hours, 22 after 5 hours, 26 after 6 hours, 30 after 7 hours, 34 after 8 hours, and 38 after 9 hours, so the answer is 38.

Sample Input 2

3 6 12

Sample Output 2

1536

Input example 2 is Geometric Germ with an hourly growth factor of 2. The answer is 24 after 3 hours, 48 after 4 hours, 96 after 5 hours, 192 after 6 hours, 384 after 7 hours, 768 after 8 hours, and 1536 after 9 hours, so the answer is 1536.