Plotting Polynomials

Graphical calculators have become popular among high school
students. They allow functions to be plotted on screen with
minimal efforts by the students. These calculators generally do
not possess very fast processors. In this problem, you are
asked to implement a method to speed up the plotting of a
polynomial.

One way to speed up the computation is to make use of
results computed previously. For example, if $p(x) = a_1 x + a_0$ and $p(i)$ has already been computed, then
$p(i+1) = p(i) + a_1$.
Thus, each successive value of $p(x)$ can be computed with one
addition each.

In general, we can compute $p(i+1)$ from $p(i)$ with $n$ additions, after the appropriate
initialization has been done. If we initialize the constants
$C_0$, $C_1$, $\ldots $, $C_ n$ appropriately, one can compute
$p(i)$ using the following
pseudocode:

Input

The input consists of one case specified on a single line.
The first integer is $n$,
where $1 \leq n \leq 6$.
This is followed by $n+1$
integer coefficients $a_ n,
\ldots , a_1, a_0$. You may assume that $|a_ i| \leq 50$ for all $i$, and $a_ n \neq 0$.