public static void main ( String args [ ] ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  int n = Integer . parseInt ( br . readLine ( ) ) ;
  int [ ] arr = new int [ n + 1 ] ;
  if ( n % 4 > 1 ) System . out . println ( - 1 ) ;
  else {
    int loops = n / 4 ;
    int start_ind = 1 ;
    int end_ind = n ;
    int front = 1 ;
    int end = n ;
    for ( int i = 0 ;
    i < loops ;
    i ++ ) {
      arr [ end_ind - 1 ] = front ++ ;
      arr [ start_ind ] = front ++ ;
      arr [ start_ind + 1 ] = end -- ;
      arr [ end_ind ] = end -- ;
      start_ind += 2 ;
      end_ind -= 2 ;
    }
    if ( n % 2 == 1 ) {
      arr [ n / 2 + 1 ] = n / 2 + 1 ;
    }
    for ( int i = 1 ;
    i < arr . length ;
    i ++ ) {
      System . out . print ( arr [ i ] + " " ) ;
    }
  }
}

public static void main ( String args [ ] ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] arr = new int [ n + 1 ] ; if ( n % 4 > 1 ) System . out . println ( - 1 ) ; else { int loops = n / 4 ; int start_ind = 1 ; int end_ind = n ; int front = 1 ; int end = n ; for ( int i = 0 ; i < loops ; i ++ ) { arr [ end_ind - 1 ] = front ++ ; arr [ start_ind ] = front ++ ; arr [ start_ind + 1 ] = end -- ; arr [ end_ind ] = end -- ; start_ind += 2 ; end_ind -= 2 ; } if ( n % 2 == 1 ) { arr [ n / 2 + 1 ] = n / 2 + 1 ; } for ( int i = 1 ; i < arr . length ; i ++ ) { System . out . print ( arr [ i ] + " ▁ " ) ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (update_expression (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (update_expression (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (update_expression (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (update_expression (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal)))))))))))