public static void main ( String [ ] args ) {
  java . util . Scanner s = new java . util . Scanner ( System . in ) ;
  int n = s . nextInt ( ) , a [ ] = new int [ n ] ;
  java . util . List < Integer > list = new java . util . ArrayList < > ( java . util . stream . IntStream . range ( 0 , n ) . map ( i -> a [ i ] = s . nextInt ( ) ) . boxed ( ) . collect ( java . util . stream . Collectors . toCollection ( java . util . TreeSet :: new ) ) ) ;
  for ( int i : a ) System . out . println ( java . util . Collections . binarySearch ( list , i ) ) ;
}

public static void main ( String [ ] args ) { java . util . Scanner s = new java . util . Scanner ( System . in ) ; int n = s . nextInt ( ) , a [ ] = new int [ n ] ; java . util . List < Integer > list = new java . util . ArrayList < > ( java . util . stream . IntStream . range ( 0 , n ) . map ( i -> a [ i ] = s . nextInt ( ) ) . boxed ( ) . collect ( java . util . stream . Collectors . toCollection ( java . util . TreeSet :: new ) ) ) ; for ( int i : a ) System . out . println ( java . util . Collections . binarySearch ( list , i ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (scoped_type_identifier (scoped_type_identifier (type_identifier) (type_identifier)) (type_identifier)) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (scoped_type_identifier (scoped_type_identifier (type_identifier) (type_identifier)) (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))) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (generic_type (scoped_type_identifier (scoped_type_identifier (type_identifier) (type_identifier)) (type_identifier)) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (scoped_type_identifier (scoped_type_identifier (type_identifier) (type_identifier)) (type_identifier)) (type_arguments)) arguments: (argument_list (method_invocation object: (method_invocation object: (method_invocation object: (method_invocation object: (field_access object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (method_invocation object: (field_access object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) field: (identifier)) name: (identifier) arguments: (argument_list (method_reference (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier))))))))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (field_access object: (field_access object: (identifier) field: (identifier)) field: (identifier)) name: (identifier) arguments: (argument_list (identifier) (identifier)))))))))