// #牛客春招刷题训练营# https://www.nowcoder.com/discuss/726480854079250432
// 我的思路来自题解,首先不是n为1和2时肯定不可能
// n为3时存在3,2,1
// 不是质数等价于存在除1和它本身的因子,而最好凑的因子莫过于2了,所以当i>3时令ai等于i
#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int n;
cin >> n;
if (n <= 2){
cout << -1;
return 0;
}
else cout << "3 2 1";
for (int i = 4; i <= n; i++)
cout << ' ' << i;
return 0;
}

京公网安备 11010502036488号