beautiful-array-qualifier2

Kevin thinks that array A is beautiful if
It contains N positive integers.
It doesn't contain any bad numbers.
There doesn't exist any number x and tuple (y1, y2, ..., yK) such that Ax = Ay1 ·  Ay2 · ...  ·  AyK (yi < x). 

Kevin knows M bad numbers Bi. Kevin also knows that 1 isn't a bad number. Now he wants to find lexicographically smallest beautiful array.

Input format:

The first line of the input contains three numbers N, K, M.  The next line contains M integers - Bi.

Output format:

Output N integers - lexicographically smallest beautiful array.

Constraints:
2 ≤ N, K ≤ 2 · 10^4 
0 ≤ M ≤ 2 · 10^4
0 ≤ Bi ≤ 10^9
N, M, K ≤ 100 in test data worth 20% of all points
M = 0 in test data worth 20% of all points

SAMPLE INPUT
7 2 3
4 7 47

SAMPLE OUTPUT
1 2 3 5 8 11 12

Source: hackerearth | Difficulty: MEDIUM


Solutions: