public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int t1 = 0 , t2 = 0 ;
  String a1 = sc . next ( ) ;
  String a2 = sc . next ( ) ;
  String a = "8<" ;
  String b = "[]" ;
  String c = "()" ;
  for ( int i = 0 ;
  i < a1 . length ( ) ;
  i += 2 ) {
    if ( a1 . substring ( i , i + 2 ) . equals ( a ) && a2 . substring ( i , i + 2 ) . equals ( b ) ) t1 ++ ;
    else if ( a2 . substring ( i , i + 2 ) . equals ( a ) && a1 . substring ( i , i + 2 ) . equals ( b ) ) t2 ++ ;
    else if ( a1 . substring ( i , i + 2 ) . equals ( b ) && a2 . substring ( i , i + 2 ) . equals ( c ) ) t1 += 1 ;
    else if ( a2 . substring ( i , i + 2 ) . equals ( b ) && a1 . substring ( i , i + 2 ) . equals ( c ) ) t2 += 1 ;
    else if ( a1 . substring ( i , i + 2 ) . equals ( c ) && a2 . substring ( i , i + 2 ) . equals ( a ) ) t1 += 1 ;
    else if ( a2 . substring ( i , i + 2 ) . equals ( c ) && a1 . substring ( i , i + 2 ) . equals ( a ) ) t2 += 1 ;
  }
  if ( t1 > t2 ) System . out . println ( "TEAM 1 WINS" ) ;
  else if ( t2 > t1 ) System . out . println ( "TEAM 2 WINS" ) ;
  else System . out . println ( "TIE" ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t1 = 0 , t2 = 0 ; String a1 = sc . next ( ) ; String a2 = sc . next ( ) ; String a = "8 < " ; String b = " [ ] " ; String c = " ( ) " ; for ( int i = 0 ; i < a1 . length ( ) ; i += 2 ) { if ( a1 . substring ( i , i + 2 ) . equals ( a ) && a2 . substring ( i , i + 2 ) . equals ( b ) ) t1 ++ ; else if ( a2 . substring ( i , i + 2 ) . equals ( a ) && a1 . substring ( i , i + 2 ) . equals ( b ) ) t2 ++ ; else if ( a1 . substring ( i , i + 2 ) . equals ( b ) && a2 . substring ( i , i + 2 ) . equals ( c ) ) t1 += 1 ; else if ( a2 . substring ( i , i + 2 ) . equals ( b ) && a1 . substring ( i , i + 2 ) . equals ( c ) ) t2 += 1 ; else if ( a1 . substring ( i , i + 2 ) . equals ( c ) && a2 . substring ( i , i + 2 ) . equals ( a ) ) t1 += 1 ; else if ( a2 . substring ( i , i + 2 ) . equals ( c ) && a1 . substring ( i , i + 2 ) . equals ( a ) ) t2 += 1 ; } if ( t1 > t2 ) System . out . println ( " TEAM ▁ 1 ▁ WINS " ) ; else if ( t2 > t1 ) System . out . println ( " TEAM ▁ 2 ▁ WINS " ) ; else System . out . println ( " TIE " ) ; }
(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: (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (update_expression (identifier))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (update_expression (identifier))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))