public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  double sum = sc . nextDouble ( ) ;
  double limit = sc . nextDouble ( ) ;
  double temp = Math . min ( sum , limit ) ;
  ArrayList < Integer > al = new ArrayList < > ( ) ;
  for ( double i = temp ;
  i > 1 ;
  i -- ) {
    if ( Math . log ( i ) / Math . log ( 2 ) == Math . floor ( Math . log ( i ) / Math . log ( 2 ) ) ) {
      if ( sum - i >= 0 ) {
        sum -= i ;
        al . add ( ( int ) i ) ;
      }
    }
  };
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; double sum = sc . nextDouble ( ) ; double limit = sc . nextDouble ( ) ; double temp = Math . min ( sum , limit ) ; ArrayList < Integer > al = new ArrayList < > ( ) ; for ( double i = temp ; i > 1 ; i -- ) { if ( Math . log ( i ) / Math . log ( 2 ) == Math . floor ( Math . log ( i ) / Math . log ( 2 ) ) ) { if ( sum - i >= 0 ) { sum -= i ; al . add ( ( int ) i ) ; } } } ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (cast_expression type: (integral_type) value: (identifier)))))))))))))