static void printGroups ( int n , int a [ ] ) {
  int ct [ ] = new int [ 7 ] , grps = n / 3 , i ;
  for ( i = 0 ;
  i < n ;
  i ++ ) {
    ct [ a [ i ] ] ++ ;
  }
  if ( ct [ 1 ] != grps || ( ct [ 4 ] + ct [ 6 ] ) != grps || ( ct [ 2 ] + ct [ 3 ] ) != grps || ct [ 4 ] > ct [ 2 ] ) {
    System . out . print ( - 1 ) ;
    return ;
  }
  for ( i = 0 ;
  i < ct [ 4 ] ;
  i ++ ) {
    System . out . print ( "1 2 4\n" ) ;
  }
  for ( i = 0 ;
  i < ct [ 2 ] - ct [ 4 ] ;
  i ++ ) {
    System . out . print ( "1 2 6\n" ) ;
  }
  for ( i = 0 ;
  i < ct [ 3 ] ;
  i ++ ) {
    System . out . print ( "1 3 6\n" ) ;
  }
}

static void printGroups ( int n , int a [ ] ) { int ct [ ] = new int [ 7 ] , grps = n / 3 , i ; for ( i = 0 ; i < n ; i ++ ) { ct [ a [ i ] ] ++ ; } if ( ct [ 1 ] != grps || ( ct [ 4 ] + ct [ 6 ] ) != grps || ( ct [ 2 ] + ct [ 3 ] ) != grps || ct [ 4 ] > ct [ 2 ] ) { System . out . print ( - 1 ) ; return ; } for ( i = 0 ; i < ct [ 4 ] ; i ++ ) { System . out . print ( "1 ▁ 2 ▁ 4 \n " ) ; } for ( i = 0 ; i < ct [ 2 ] - ct [ 4 ] ; i ++ ) { System . out . print ( "1 ▁ 2 ▁ 6 \n " ) ; } for ( i = 0 ; i < ct [ 3 ] ; i ++ ) { System . out . print ( "1 ▁ 3 ▁ 6 \n " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal)))) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal))) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) right: (identifier))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) right: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) (return_statement))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))