public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  TreeSet < String > suffixes = new TreeSet < > ( ) ;
  String word = sc . nextLine ( ) ;
  sc . close ( ) ;
  String tempSubstring ;
  boolean doubleStepIsPossible [ ] = new boolean [ word . length ( ) ] ;
  boolean tripleStepIsPossible [ ] = new boolean [ word . length ( ) ] ;
  if ( word . length ( ) <= 6 ) {
    System . out . println ( "0" ) ;
    return ;
  }
  int wordLength = word . length ( ) ;
  doubleStepIsPossible [ wordLength - 2 ] = true ;
  suffixes . add ( word . substring ( wordLength - 2 , wordLength ) ) ;
  if ( wordLength > 7 ) {
    tripleStepIsPossible [ wordLength - 3 ] = true ;
    suffixes . add ( word . substring ( wordLength - 3 , wordLength ) ) ;
  }
  for ( int i = wordLength - 4 ;
  i >= 5 ;
  i -- ) {
    tempSubstring = word . substring ( i , i + 2 ) ;
    if ( tripleStepIsPossible [ i + 2 ] || ( doubleStepIsPossible [ i + 2 ] && ( ! tempSubstring . equals ( word . substring ( i + 2 , i + 4 ) ) ) ) ) {
      doubleStepIsPossible [ i ] = true ;
      suffixes . add ( tempSubstring ) ;
    }
    tempSubstring = word . substring ( i , i + 3 ) ;
    if ( doubleStepIsPossible [ i + 3 ] || ( tripleStepIsPossible [ i + 3 ] && ( ! tempSubstring . equals ( word . substring ( i + 3 , i + 6 ) ) ) ) ) {
      tripleStepIsPossible [ i ] = true ;
      suffixes . add ( tempSubstring ) ;
    }
  }
  System . out . println ( suffixes . size ( ) ) ;
  suffixes . forEach ( System . out :: println ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; TreeSet < String > suffixes = new TreeSet < > ( ) ; String word = sc . nextLine ( ) ; sc . close ( ) ; String tempSubstring ; boolean doubleStepIsPossible [ ] = new boolean [ word . length ( ) ] ; boolean tripleStepIsPossible [ ] = new boolean [ word . length ( ) ] ; if ( word . length ( ) <= 6 ) { System . out . println ( "0" ) ; return ; } int wordLength = word . length ( ) ; doubleStepIsPossible [ wordLength - 2 ] = true ; suffixes . add ( word . substring ( wordLength - 2 , wordLength ) ) ; if ( wordLength > 7 ) { tripleStepIsPossible [ wordLength - 3 ] = true ; suffixes . add ( word . substring ( wordLength - 3 , wordLength ) ) ; } for ( int i = wordLength - 4 ; i >= 5 ; i -- ) { tempSubstring = word . substring ( i , i + 2 ) ; if ( tripleStepIsPossible [ i + 2 ] || ( doubleStepIsPossible [ i + 2 ] && ( ! tempSubstring . equals ( word . substring ( i + 2 , i + 4 ) ) ) ) ) { doubleStepIsPossible [ i ] = true ; suffixes . add ( tempSubstring ) ; } tempSubstring = word . substring ( i , i + 3 ) ; if ( doubleStepIsPossible [ i + 3 ] || ( tripleStepIsPossible [ i + 3 ] && ( ! tempSubstring . equals ( word . substring ( i + 3 , i + 6 ) ) ) ) ) { tripleStepIsPossible [ i ] = true ; suffixes . add ( tempSubstring ) ; } } System . out . println ( suffixes . size ( ) ) ; suffixes . forEach ( System . out :: println ) ; }
(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))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (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: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (return_statement))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (true))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (true))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (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))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_reference (field_access object: (identifier) field: (identifier)) (identifier)))))))