#include<stdio.h>
int main(){
  long long n;
  scanf("%lld",&n);
  if (n==1) printf("2 0 1");else
    if (n==2) printf("3 8 1 0 5 7 6 2 4");else
      if (n==3) printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");else
              printf("-1");
              
  
}