The first line contains a positive integer ().The second line contains integers ().
Output lines, each of which contains a single integer , denoting the answer taken modulo ---the -th number is for the answer of .
5 2 4 8 7 5
178 390 707 1022 1341 1232 995 612 283