public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  HashMap < Character , Character > map = new HashMap < Character , Character > ( ) ;
  map . put ( 'b' , '1' ) ;
  map . put ( 'c' , '1' ) ;
  map . put ( 'd' , '2' ) ;
  map . put ( 'w' , '2' ) ;
  map . put ( 't' , '3' ) ;
  map . put ( 'j' , '3' ) ;
  map . put ( 'f' , '4' ) ;
  map . put ( 'q' , '4' ) ;
  map . put ( 'l' , '5' ) ;
  map . put ( 'v' , '5' ) ;
  map . put ( 's' , '6' ) ;
  map . put ( 'x' , '6' ) ;
  map . put ( 'p' , '7' ) ;
  map . put ( 'm' , '7' ) ;
  map . put ( 'h' , '8' ) ;
  map . put ( 'k' , '8' ) ;
  map . put ( 'n' , '9' ) ;
  map . put ( 'g' , '9' ) ;
  map . put ( 'z' , '0' ) ;
  map . put ( 'r' , '0' ) ;
  int N = sc . nextInt ( ) ;
  List < String > result = new ArrayList < String > ( ) ;
  char w [ ] [ ] = new char [ N ] [ ] ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    w [ i ] = sc . next ( ) . toLowerCase ( ) . toCharArray ( ) ;
  }
  for ( int i = 0 ;
  i < w . length ;
  i ++ ) {
    StringBuilder sb = new StringBuilder ( ) ;
    for ( char c : w [ i ] ) {
      Character num = map . get ( c ) ;
      if ( num != null ) {
        sb . append ( num ) ;
      }
    }
    if ( sb . length ( ) > 0 ) {
      result . add ( sb . toString ( ) ) ;
    }
  }
  System . out . println ( String . join ( " " , result ) ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; HashMap < Character , Character > map = new HashMap < Character , Character > ( ) ; map . put ( ' b ' , '1' ) ; map . put ( ' c ' , '1' ) ; map . put ( ' d ' , '2' ) ; map . put ( ' w ' , '2' ) ; map . put ( ' t ' , '3' ) ; map . put ( ' j ' , '3' ) ; map . put ( ' f ' , '4' ) ; map . put ( ' q ' , '4' ) ; map . put ( ' l ' , '5' ) ; map . put ( ' v ' , '5' ) ; map . put ( ' s ' , '6' ) ; map . put ( ' x ' , '6' ) ; map . put ( ' p ' , '7' ) ; map . put ( ' m ' , '7' ) ; map . put ( ' h ' , '8' ) ; map . put ( ' k ' , '8' ) ; map . put ( ' n ' , '9' ) ; map . put ( ' g ' , '9' ) ; map . put ( ' z ' , '0' ) ; map . put ( ' r ' , '0' ) ; int N = sc . nextInt ( ) ; List < String > result = new ArrayList < String > ( ) ; char w [ ] [ ] = new char [ N ] [ ] ; for ( int i = 0 ; i < N ; i ++ ) { w [ i ] = sc . next ( ) . toLowerCase ( ) . toCharArray ( ) ; } for ( int i = 0 ; i < w . length ; i ++ ) { StringBuilder sb = new StringBuilder ( ) ; for ( char c : w [ i ] ) { Character num = map . get ( c ) ; if ( num != null ) { sb . append ( num ) ; } } if ( sb . length ( ) > 0 ) { result . add ( sb . toString ( ) ) ; } } System . out . println ( String . join ( " ▁ " , result ) ) ; }
(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: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (character_literal) (character_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier))) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)) name: (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (identifier))))))))