Ranran has a sequence a of n integers a1,a2,⋯,an which satisfies


and he is very proud of it, so he comes up with a problem for you.
You need to find out a sequence c of m integers c0,c1,⋯,cm−1. With c, you construct an infinite sequence b, and bi equals to ci mod m. b must satisfy the condition that in every consecutive ai numbers of b there exists a number equals to i.
Please note that a is 1-indexed and b, c are 0-indexed. The value of m is decided by you.
Can you solve the problem?