public static void main ( String [ ] args ) {
  Scanner input = new Scanner ( System . in ) ;
  String [ ] s = {
    "C" , "C#" , "D" , "D#" , "E" , "F" , "F#" , "G" , "G#" , "A" , "B" , "H" };
    String a = input . next ( ) ;
    String b = input . next ( ) ;
    String c = input . next ( ) ;
    int [ ] d = new int [ 3 ] ;
    for ( int i = 0 ;
    i < 12 ;
    i ++ ) {
      if ( a . equals ( s [ i ] ) ) d [ 0 ] = i ;
      if ( b . equals ( s [ i ] ) ) d [ 1 ] = i ;
      if ( c . equals ( s [ i ] ) ) d [ 2 ] = i ;
    }
    String ans = "" ;
    Arrays . sort ( d ) ;
    if ( ( d [ 1 ] - d [ 0 ] == 4 && d [ 2 ] - d [ 1 ] == 3 ) || ( 12 - ( d [ 2 ] - d [ 0 ] ) == 4 && d [ 1 ] - d [ 0 ] == 3 ) || ( d [ 2 ] - d [ 1 ] == 4 && 12 - ( d [ 2 ] - d [ 0 ] ) == 3 ) ) System . out . println ( "major" ) ;
    else if ( ( d [ 1 ] - d [ 0 ] == 3 && d [ 2 ] - d [ 1 ] == 4 ) || ( 12 - ( d [ 2 ] - d [ 0 ] ) == 3 && d [ 1 ] - d [ 0 ] == 4 ) || ( d [ 2 ] - d [ 1 ] == 3 && 12 - ( d [ 2 ] - d [ 0 ] ) == 4 ) ) System . out . println ( "minor" ) ;
    else System . out . println ( "strange" ) ;
  }
  
public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String [ ] s = { " C " , " C # " , " D " , " D # " , " E " , " F " , " F # " , " G " , " G # " , " A " , " B " , " H " } ; String a = input . next ( ) ; String b = input . next ( ) ; String c = input . next ( ) ; int [ ] d = new int [ 3 ] ; for ( int i = 0 ; i < 12 ; i ++ ) { if ( a . equals ( s [ i ] ) ) d [ 0 ] = i ; if ( b . equals ( s [ i ] ) ) d [ 1 ] = i ; if ( c . equals ( s [ i ] ) ) d [ 2 ] = i ; } String ans = " " ; Arrays . sort ( d ) ; if ( ( d [ 1 ] - d [ 0 ] == 4 && d [ 2 ] - d [ 1 ] == 3 ) || ( 12 - ( d [ 2 ] - d [ 0 ] ) == 4 && d [ 1 ] - d [ 0 ] == 3 ) || ( d [ 2 ] - d [ 1 ] == 4 && 12 - ( d [ 2 ] - d [ 0 ] ) == 3 ) ) System . out . println ( " major " ) ; else if ( ( d [ 1 ] - d [ 0 ] == 3 && d [ 2 ] - d [ 1 ] == 4 ) || ( 12 - ( d [ 2 ] - d [ 0 ] ) == 3 && d [ 1 ] - d [ 0 ] == 4 ) || ( d [ 2 ] - d [ 1 ] == 3 && 12 - ( d [ 2 ] - d [ 0 ] ) == 4 ) ) 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: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) 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)))) (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: (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))))) (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 (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (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)))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (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))))) right: (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: (decimal_integer_literal) right: (parenthesized_expression (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 (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: (binary_expression left: (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)))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (parenthesized_expression (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))))) right: (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: (decimal_integer_literal) right: (parenthesized_expression (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 (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))))))))