public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  String str = sc . next ( ) ;
  int [ ] a = mp ( str ) ;
  int n = str . length ( ) ;
  int shuki = n - a [ n ] ;
  if ( shuki == 1 ) {
    System . out . println ( n ) ;
    System . out . println ( 1 ) ;
  }
  else if ( n % shuki != 0 || shuki == n ) {
    System . out . println ( 1 ) ;
    System . out . println ( 1 ) ;
  }
  else {
    System . out . println ( 2 ) ;
    StringBuilder restr = new StringBuilder ( ) ;
    for ( int i = n - 1 ;
    i >= 0 ;
    i -- ) restr . append ( str . charAt ( i ) ) ;
    int [ ] b = mp ( restr . toString ( ) ) ;
    int count = 0 ;
    for ( int i = 0 ;
    i < n ;
    i ++ ) {
      int shuki1 = i + 1 - a [ i + 1 ] ;
      if ( shuki1 != ( i + 1 ) && ( i + 1 ) % shuki1 == 0 ) continue ;
      int shuki2 = n - i - 1 - b [ n - i - 1 ] ;
      if ( shuki2 != ( n - i - 1 ) && ( n - i - 1 ) % shuki2 == 0 ) continue ;
      count ++ ;
    }
    System . out . println ( count ) ;
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String str = sc . next ( ) ; int [ ] a = mp ( str ) ; int n = str . length ( ) ; int shuki = n - a [ n ] ; if ( shuki == 1 ) { System . out . println ( n ) ; System . out . println ( 1 ) ; } else if ( n % shuki != 0 || shuki == n ) { System . out . println ( 1 ) ; System . out . println ( 1 ) ; } else { System . out . println ( 2 ) ; StringBuilder restr = new StringBuilder ( ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) restr . append ( str . charAt ( i ) ) ; int [ ] b = mp ( restr . toString ( ) ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int shuki1 = i + 1 - a [ i + 1 ] ; if ( shuki1 != ( i + 1 ) && ( i + 1 ) % shuki1 == 0 ) continue ; int shuki2 = n - i - 1 - b [ n - i - 1 ] ; if ( shuki2 != ( n - i - 1 ) && ( n - i - 1 ) % shuki2 == 0 ) continue ; count ++ ; } System . out . println ( count ) ; } }
(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) 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: (method_invocation name: (identifier) arguments: (argument_list (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (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: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier)) right: (decimal_integer_literal)))) consequence: (continue_statement)) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (identifier)) right: (decimal_integer_literal)))) consequence: (continue_statement)) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))))))))