public static void main ( String args [ ] ) throws Exception {
  StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( "\\A" ) . next ( ) ) ;
  StringBuilder sb = new StringBuilder ( ) ;
  int n = Integer . parseInt ( stok . nextToken ( ) ) ;
  int k = Integer . parseInt ( stok . nextToken ( ) ) ;
  char [ ] s = stok . nextToken ( ) . toCharArray ( ) ;
  int [ ] a = new int [ n + 1 ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) a [ i ] = s [ i ] - 48 ;
  int r = 0 ;
  for ( int i = k ;
  i < n && r == 0 ;
  i ++ ) if ( a [ i ] > a [ i % k ] ) r = i ;
  else if ( a [ i ] < a [ i % k ] ) break ;
  while ( a [ r ] > a [ r % k ] ) {
    int c = 1 ;
    a [ r -- ] = 0 ;
    while ( c == 1 ) {
      if ( a [ r ] < 9 ) {
        a [ r ] ++ ;
        c = 0 ;
      }
      else a [ r -- ] = 0 ;
    }
  }
  System . out . println ( n ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) sb . append ( a [ i % k ] ) ;
  System . out . println ( sb ) ;
}

public static void main ( String args [ ] ) throws Exception { StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( " \\ A " ) . next ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( stok . nextToken ( ) ) ; int k = Integer . parseInt ( stok . nextToken ( ) ) ; char [ ] s = stok . nextToken ( ) . toCharArray ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = s [ i ] - 48 ; int r = 0 ; for ( int i = k ; i < n && r == 0 ; i ++ ) if ( a [ i ] > a [ i % k ] ) r = i ; else if ( a [ i ] < a [ i % k ] ) break ; while ( a [ r ] > a [ r % k ] ) { int c = 1 ; a [ r -- ] = 0 ; while ( c == 1 ) { if ( a [ r ] < 9 ) { a [ r ] ++ ; c = 0 ; } else a [ r -- ] = 0 ; } } System . out . println ( n ) ; for ( int i = 0 ; i < n ; i ++ ) sb . append ( a [ i % k ] ) ; System . out . println ( sb ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) name: (identifier) arguments: (argument_list (string_literal))) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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 object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) 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 (binary_expression left: (identifier) right: (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))))) (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: (identifier))) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) consequence: (break_statement)))) (while_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (update_expression (identifier))) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (update_expression (identifier))) right: (decimal_integer_literal)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))