시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 1024 MB377746.667%

문제

Consider all arrays with length $n$ consisting of integers from $1$ to $m$. Let $P$ be the minimum number of continuous subarrays that are palindromic one such array can have. Recall that an array is palindromic if it is equal to its own reverse.

Find the $k$-th lexicographically minimal array with $P$ continuous subarrays that are palindromic. We are still only considering arrays with length $n$ consisting of integers from $1$ to $m$.

In other words, let's take all arrays with length $n$ consisting of integers from $1$ to $m$, leave only those of them that have the minimum number of continuous subarrays that are palindromic, and sort them lexicographically. Your task is to find $k$-th of them in this order.

입력

The only line of input contains three integers $n$, $m$ and $k$ ($1 \le n \le 10^6$, $1 \le m \le 10^6$, $1 \le k \le 10^{18}$).

출력

If there are less than $k$ valid arrays, print -1. Otherwise, print the $k$-th lexicographically minimal of them.

예제 입력 1

1 1 1

예제 출력 1

1

예제 입력 2

2 2 2

예제 출력 2

2 1

예제 입력 3

3 3 3

예제 출력 3

2 1 3

예제 입력 4

9 9 8244353

예제 출력 4

2 4 1 2 6 8 1 2 7

예제 입력 5

10 7 998244353

예제 출력 5

-1

예제 입력 6

3 1000 994253860

예제 출력 6

998 244 353

노트

Did we put min number of min in the title? Min.