Exact Longest Monotone Subsequence

No attempts yetTime limit1sMemory limit256 MB

Problem

Finding the longest monotone subsequence of a given sequence is a well known exercise. This task turns it around: you build the sequence yourself.

For given NN and KK, find a sequence in which every number from 11 to NN appears exactly once and whose longest monotone subsequence has length exactly KK. A monotone subsequence is one that is increasing or decreasing.

A subsequence keeps the order of the original sequence, and the chosen elements do not have to be adjacent. An increasing subsequence has values that keep growing, a decreasing subsequence has values that keep shrinking.

Input

The first line contains the length of the sequence NN and the required length of the longest monotone subsequence KK, separated by a single space. (1KN1061 \le K \le N \le 10^6)

Output

If no such sequence exists, print 1-1 on the first line.

If such a sequence exists, print on the first line the lexicographically smallest one among the sequences that satisfy the condition. Write the NN numbers on one line, separated by single spaces.

To compare two sequences lexicographically, find the first position where they differ, and treat the sequence with the smaller number at that position as the earlier one.

Hint

For N=4N = 4 and K=3K = 3 the sequence (1,4,2,3)(1, 4, 2, 3) also satisfies the condition. Its longest monotone subsequence is (1,2,3)(1, 2, 3), of length 33. The lexicographically smallest sequence that satisfies the condition is (1,2,4,3)(1, 2, 4, 3), so that one is the answer.