Winning Ballot

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Loznica is a city in Serbia, famous by history, culture, pleasant weather... and lottery! Lottery in Loznica is held with following rules:

  • Ballot contains combination of NN natural numbers, smaller than 101810^{18} will be picked.
  • In this lottery, numbers can repeat and order of them is important.

Aljoha, the hero of our story, using some obscure utilities, managed to find out some information about the next winning ballot. Let the future combination be L_iL\_{i}, 1iN1 \leq i \leq N. Aloha managed to find out an array containing N1N-1 numbers, in which the iith number A_iA\_{i} represents the largest number which divides both L_iL\_{i} and L_i+1L\_{i+1}.

Now Aljoha wants to bet, and for that noble goal he needs help. Print one combination which satisfies the constraints or 1-1, if that kind of combination doesn't exist. If there are more combinations that satisfy given constraints, print any of them. Note that only combinations in which all numbers are strictly smaller than 101810^{18} are valid.

입력

First line contains number NN (1N1051 \leq N \leq 10^5), length of combination.

Second line contains N1N-1 positive integers not greater than 10910^9, describing the information that Aljoha found out.

출력

Print NN numbers, strictly less than 101810^{18}, describing some combination which satisfies the constraints or 1-1 if there is no such combination.