While reviewing for his upcoming math test, Josh has become stumped on a difficult problem and asks you for help.
In the problem, there is a sequence of integers whose first term is . Additionally, if the current term is , the next term in the sequence will be equal to , where and are integers given by the problem. For example, if and , the first three terms are , , and respectively. Josh's task is to find the first five terms of this sequence.
Please help Josh solve this problem by printing out the first five terms.
Input Specifications
The first line of input will contain two space-separated integers, and .
Output Specifications
Output five lines each containing one integer representing the first five terms of the sequence.
Note: It can be proven that all five terms will always fit in a -bit signed integer.
Sample Input
4 -2
Sample Output
0
-2
-6
10
138
Comments