public static void main ( String [ ] args ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  int n = Integer . parseInt ( br . readLine ( ) ) ;
  int [ ] kk = new int [ 100 ] ;
  int [ ] pp = new int [ 100 ] ;
  int [ ] qq = new int [ 100 ] ;
  StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ;
  int [ ] aa = new int [ n + n ] ;
  for ( int i = 0 ;
  i < n + n ;
  i ++ ) {
    int a = Integer . parseInt ( st . nextToken ( ) ) ;
    kk [ a ] ++ ;
    aa [ i ] = a ;
  }
  int p = 0 , q = 0 ;
  for ( int a = 10 ;
  a <= 99 ;
  a ++ ) if ( kk [ a ] >= 2 ) {
    p ++ ;
    q ++ ;
    pp [ a ] ++ ;
    qq [ a ] ++ ;
    kk [ a ] -= 2 ;
  }
  else if ( kk [ a ] >= 1 && p <= q ) {
    p ++ ;
    pp [ a ] ++ ;
    kk [ a ] -- ;
  }
  else if ( kk [ a ] >= 1 && p > q ) {
    q ++ ;
    qq [ a ] ++ ;
    kk [ a ] -- ;
  }
  int m = p * q ;
  for ( int a = 10 ;
  a <= 99 ;
  a ++ ) while ( kk [ a ] > 0 ) if ( p <= q ) {
    p ++ ;
    pp [ a ] ++ ;
    kk [ a ] -- ;
  }
  else {
    q ++ ;
    qq [ a ] ++ ;
    kk [ a ] -- ;
  }
  StringBuilder sb = new StringBuilder ( ) ;
  for ( int i = 0 ;
  i < n + n ;
  i ++ ) {
    int a = aa [ i ] , g ;
    if ( pp [ a ] > 0 ) {
      g = 1 ;
      pp [ a ] -- ;
    }
    else {
      g = 2 ;
      qq [ a ] -- ;
    }
    sb . append ( g + " " ) ;
  }
  System . out . println ( m ) ;
  System . out . println ( sb ) ;
}

public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] kk = new int [ 100 ] ; int [ ] pp = new int [ 100 ] ; int [ ] qq = new int [ 100 ] ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] aa = new int [ n + n ] ; for ( int i = 0 ; i < n + n ; i ++ ) { int a = Integer . parseInt ( st . nextToken ( ) ) ; kk [ a ] ++ ; aa [ i ] = a ; } int p = 0 , q = 0 ; for ( int a = 10 ; a <= 99 ; a ++ ) if ( kk [ a ] >= 2 ) { p ++ ; q ++ ; pp [ a ] ++ ; qq [ a ] ++ ; kk [ a ] -= 2 ; } else if ( kk [ a ] >= 1 && p <= q ) { p ++ ; pp [ a ] ++ ; kk [ a ] -- ; } else if ( kk [ a ] >= 1 && p > q ) { q ++ ; qq [ a ] ++ ; kk [ a ] -- ; } int m = p * q ; for ( int a = 10 ; a <= 99 ; a ++ ) while ( kk [ a ] > 0 ) if ( p <= q ) { p ++ ; pp [ a ] ++ ; kk [ a ] -- ; } else { q ++ ; qq [ a ] ++ ; kk [ a ] -- ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n + n ; i ++ ) { int a = aa [ i ] , g ; if ( pp [ a ] > 0 ) { g = 1 ; pp [ a ] -- ; } else { g = 2 ; qq [ a ] -- ; } sb . append ( g + " ▁ " ) ; } System . out . println ( m ) ; System . out . println ( sb ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (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 (decimal_integer_literal))))) (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 (decimal_integer_literal))))) (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 (decimal_integer_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_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: (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: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (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)))))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (while_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) body: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) alternative: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (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: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier))) declarator: (variable_declarator name: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))