static void PowerOfTwo ( int [ ] x , int n ) {
  Arrays . sort ( x ) ;
  ArrayList < Integer > res = new ArrayList < Integer > ( ) ;
  for ( int i = 0 ;
  i < n ;
  ++ i ) {
    for ( int j = 1 ;
    j < 31 ;
    ++ j ) {
      int lx = x [ i ] - ( 1 << j ) ;
      int rx = x [ i ] + ( 1 << j ) ;
      boolean isl = Arrays . binarySearch ( x , lx ) < 0 ? false : true ;
      boolean isr = Arrays . binarySearch ( x , rx ) < 0 ? false : true ;
      if ( isl && isr && res . size ( ) < 3 ) {
        res . clear ( ) ;
        res . add ( lx ) ;
        res . add ( x [ i ] ) ;
        res . add ( rx ) ;
      }
      if ( isl && res . size ( ) < 2 ) {
        res . clear ( ) ;
        res . add ( lx ) ;
        res . add ( x [ i ] ) ;
      }
      if ( isr && res . size ( ) < 2 ) {
        res . clear ( ) ;
        res . add ( x [ i ] ) ;
        res . add ( rx ) ;
      }
    }
  }
  if ( res . size ( ) == 0 ) {
    System . out . println ( "-1" ) ;
    return ;
  }
  for ( int i = 0 ;
  i < res . size ( ) ;
  i ++ ) System . out . print ( res . get ( i ) + " " ) ;
}

static void PowerOfTwo ( int [ ] x , int n ) { Arrays . sort ( x ) ; ArrayList < Integer > res = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = 1 ; j < 31 ; ++ j ) { int lx = x [ i ] - ( 1 << j ) ; int rx = x [ i ] + ( 1 << j ) ; boolean isl = Arrays . binarySearch ( x , lx ) < 0 ? false : true ; boolean isr = Arrays . binarySearch ( x , rx ) < 0 ? false : true ; if ( isl && isr && res . size ( ) < 3 ) { res . clear ( ) ; res . add ( lx ) ; res . add ( x [ i ] ) ; res . add ( rx ) ; } if ( isl && res . size ( ) < 2 ) { res . clear ( ) ; res . add ( lx ) ; res . add ( x [ i ] ) ; } if ( isr && res . size ( ) < 2 ) { res . clear ( ) ; res . add ( x [ i ] ) ; res . add ( rx ) ; } } } if ( res . size ( ) == 0 ) { System . out . println ( " - 1" ) ; return ; } for ( int i = 0 ; i < res . size ( ) ; i ++ ) System . out . print ( res . get ( i ) + " ▁ " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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 (type_identifier))) arguments: (argument_list)))) (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 (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))) right: (decimal_integer_literal)) consequence: (false) alternative: (true)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))) right: (decimal_integer_literal)) consequence: (false) alternative: (true)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (string_literal))))))))