public static void main ( String [ ] args ) {
  Scanner in = new Scanner ( System . in ) ;
  String s [ ] = {
    "C" , "C#" , "D" , "D#" , "E" , "F" , "F#" , "G" , "G#" , "A" , "B" , "H" , "C" , "C#" , "D" , "D#" , "E" , "F" , "F#" , "G" , "G#" , "A" , "B" , "H" , "C" , "C#" , "D" , "D#" , "E" , "F" , "F#" , "G" , "G#" , "A" , "B" , "H" };
    int arr [ ] = new int [ 3 ] ;
    String str [ ] ;
    String str2 [ ] = new String [ 3 ] ;
    for ( int i = 0 ;
    i < 3 ;
    i ++ ) str2 [ i ] = in . next ( ) ;
    boolean isMajor = false , isMinor = false ;
    for ( int a = 0 ;
    a < 3 ;
    a ++ ) for ( int b = 0 ;
    b < 3 ;
    b ++ ) if ( a != b ) for ( int c = 0 ;
    c < 3 ;
    c ++ ) if ( c != a && c != b ) {
      str = new String [ ] {
        str2 [ a ] , str2 [ b ] , str2 [ c ] };
        int last = - 1 ;
        for ( int i = 0 ;
        i < 3 ;
        i ++ ) {
          List < String > lst = Arrays . asList ( s ) ;
          arr [ i ] = last = lst . subList ( last + 1 , lst . size ( ) ) . indexOf ( str [ i ] ) + last + 1 ;
        }
        if ( arr [ 1 ] - arr [ 0 ] == 4 && arr [ 2 ] - arr [ 1 ] == 3 ) isMajor = true ;
        else if ( arr [ 1 ] - arr [ 0 ] == 3 && arr [ 2 ] - arr [ 1 ] == 4 ) isMinor = true ;
      }
      if ( isMajor ) System . out . println ( "major" ) ;
      else if ( isMinor ) System . out . println ( "minor" ) ;
      else System . out . println ( "strange" ) ;
    }
    
public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s [ ] = { " C " , " C # " , " D " , " D # " , " E " , " F " , " F # " , " G " , " G # " , " A " , " B " , " H " , " C " , " C # " , " D " , " D # " , " E " , " F " , " F # " , " G " , " G # " , " A " , " B " , " H " , " C " , " C # " , " D " , " D # " , " E " , " F " , " F # " , " G " , " G # " , " A " , " B " , " H " } ; int arr [ ] = new int [ 3 ] ; String str [ ] ; String str2 [ ] = new String [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) str2 [ i ] = in . next ( ) ; boolean isMajor = false , isMinor = false ; for ( int a = 0 ; a < 3 ; a ++ ) for ( int b = 0 ; b < 3 ; b ++ ) if ( a != b ) for ( int c = 0 ; c < 3 ; c ++ ) if ( c != a && c != b ) { str = new String [ ] { str2 [ a ] , str2 [ b ] , str2 [ c ] } ; int last = - 1 ; for ( int i = 0 ; i < 3 ; i ++ ) { List < String > lst = Arrays . asList ( s ) ; arr [ i ] = last = lst . subList ( last + 1 , lst . size ( ) ) . indexOf ( str [ i ] ) + last + 1 ; } if ( arr [ 1 ] - arr [ 0 ] == 4 && arr [ 2 ] - arr [ 1 ] == 3 ) isMajor = true ; else if ( arr [ 1 ] - arr [ 0 ] == 3 && arr [ 2 ] - arr [ 1 ] == 4 ) isMinor = true ; } if ( isMajor ) System . out . println ( " major " ) ; else if ( isMinor ) System . out . println ( " minor " ) ; else System . out . println ( " strange " ) ; }
(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: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_initializer (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal) (string_literal)))) (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))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false)) declarator: (variable_declarator name: (identifier) value: (false))) (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: (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: (identifier) right: (identifier))) consequence: (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: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (type_identifier) dimensions: (dimensions) value: (array_initializer (array_access array: (identifier) index: (identifier)) (array_access array: (identifier) index: (identifier)) (array_access array: (identifier) index: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (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: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (identifier)) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) right: (decimal_integer_literal)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true))))))))))) (if_statement condition: (parenthesized_expression (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 (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))))))))