Sketch

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

문제

Given a sequence aa consisting of integers a_1,,a_na\_1, \ldots, a\_n, consider all its non-decreasing subsequences of length kk. Among all of these take the one with smallest last element. We denote the value of this element with s_ks\_k.

The sequence s(a)=s_1,,s_ls(a) = s\_1, \ldots, s\_{l} is a sketch for sequence aa, where ll is the length of the longest non-decreasing subsequence of aa.

Building a sketch of the sequence is a standard task while finding the length of the longest non-decreasing subsequence. Here we consider an opposite problem: given a sketch with some missing entries, find any sequence producing this sketch.

Formally, you are given a sequence t_1,,t_kt\_1, \ldots, t\_k where each element is either a positive integer or 1-1. You have to find a sequence a_1,,a_na\_1, \ldots, a\_n with each element being an integer between 11 and mm, inclusive, satisfying the following properties: length of the sketch of aa should be equal to kk, and for each index ii between 11 and kk, if t_i1t\_i \neq -1, then s_i=t_is\_i = t\_i should hold.

입력

First line contains three integers kk, nn, mm (1k300,0001 \leq k \leq 300\\,000, 1n300,0001 \leq n \leq 300\\,000, 1m1091 \leq m \leq 10^9), the length of the sketch, the length of the desired sequence and the upper bound on element values respectively.

Next line contains kk numbers t_1,,t_kt\_1, \ldots, t\_k (1t_im1 \leq t\_i \leq m or t_i=1t\_i = -1), the sketch itself.

출력

If a sequence with such sketch exists, output the elements of a desired sequence. In case of multiple answers you may output any of them.

If no valid sequence exists, output a single integer 1-1.

힌트

Sketch of the answer sequence in example 2: 3 4 73\ 4\ 7.