logo AlgoBeat OnlineJudge
登录 注册

#209202. [ICPC 2020 Nanjing R] K Co-prime Permutation

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Kotori is very good at math (really?) and she loves playing with permutations and primes.

One day, she thinks of a special kind of permutation named . A permutation of is called a co-prime permutation of if there exists exactly integers such that and , where indicates the greatest common divisor of and .

Given and , please help Kotori construct a co-prime permutation of or just report that there is no such permutation.

Recall that a permutation of is a sequence of length containing all integers from to .

输入格式

There is only one test case in each test file.

The first and only line contains two integers and (, ).

输出格式

Output one line containing integers separated by one space, indicating the permutation satisfying the given constraints. If no such permutation exists output -1 (without quotes) instead. If there are multiple valid answers you can print any of them.

Please, DO NOT output extra spaces at the end of each line, otherwise your answer may be considered incorrect!

样例

样例输入 1

5 3

样例输出 1

1 4 5 2 3

样例输入 2

1 0

样例输出 2

-1