public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  String [ ] arr = new String [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) arr [ i ] = sc . next ( ) ;
  for ( int i = 1 ;
  i < n ;
  i ++ ) {
    String temp = arr [ i ] ;
    int j = i - 1 ;
    while ( j >= 0 && temp . length ( ) < arr [ j ] . length ( ) ) {
      arr [ j + 1 ] = arr [ j ] ;
      j -- ;
    }
    arr [ j + 1 ] = temp ;
  }
  int c = 1 ;
  for ( int i = 1 ;
  i < n ;
  i ++ ) {
    if ( arr [ i ] . contains ( arr [ i - 1 ] ) ) c ++ ;
  }
  if ( c == n ) {
    System . out . println ( "YES" ) ;
    for ( int i = 0 ;
    i < n ;
    i ++ ) System . out . println ( arr [ i ] ) ;
  }
  else System . out . println ( "NO" ) ;
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] arr = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . next ( ) ; for ( int i = 1 ; i < n ; i ++ ) { String temp = arr [ i ] ; int j = i - 1 ; while ( j >= 0 && temp . length ( ) < arr [ j ] . length ( ) ) { arr [ j + 1 ] = arr [ j ] ; j -- ; } arr [ j + 1 ] = temp ; } int c = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] . contains ( arr [ i - 1 ] ) ) c ++ ; } if ( c == n ) { System . out . println ( " YES " ) ; for ( int i = 0 ; i < n ; i ++ ) System . out . println ( arr [ i ] ) ; } else System . out . println ( " NO " ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (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: (identifier)) 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))))) (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list))))) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))))) (local_variable_declaration type: (integral_type) 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: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) consequence: (expression_statement (update_expression (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (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: (identifier)) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))