Score : $300$ points
Snuke had $N$ cards numbered $1$ through $N$. Each card has an integer written on it; written on Card $i$ is $a_i$.
Snuke did the following procedure:
Under the constraints in this problem, it can be proved that the procedure will eventually terminate. Find the number written on all of Snuke's cards after the procedure.
Input is given from Standard Input in the following format:
$N$ $a_1$ $a_2$ $\cdots$ $a_N$
Print the number written on all of Snuke's cards after the procedure.
3 2 6 6
2
15 546 3192 1932 630 2100 4116 3906 3234 1302 1806 3528 3780 252 1008 588
42