public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  int k = sc . nextInt ( ) ;
  sc . nextLine ( ) ;
  String s = sc . nextLine ( ) ;
  char ans [ ] = new char [ n ] ;
  System . out . println ( n ) ;
  for ( int i = 0 ;
  i < k ;
  i ++ ) {
    for ( int j = i ;
    j < n ;
    j += k ) {
      ans [ j ] = s . charAt ( i ) ;
    }
  }
  boolean less = false ;
  int idx = - 1 ;
  char cc = ' ' ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( ans [ i ] > s . charAt ( i ) ) break ;
    if ( ans [ i ] < s . charAt ( i ) ) {
      less = true ;
      idx = i ;
      break ;
    }
  }
  if ( ! less ) System . out . println ( ans ) ;
  else {
    int min_idx = - 1 ;
    for ( int i = 0 ;
    i < k ;
    i ++ ) {
      if ( s . charAt ( i ) != '9' ) min_idx = i ;
    }
    min_idx = Math . min ( idx , min_idx ) ;
    for ( int i = min_idx ;
    i < k ;
    i ++ ) {
      for ( int j = i ;
      j < n ;
      j += k ) {
        if ( i == min_idx ) ans [ j ] = ( char ) ( s . charAt ( i ) + 1 ) ;
        else ans [ j ] = '0' ;
      }
    }
    System . out . println ( ans ) ;
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; char ans [ ] = new char [ n ] ; System . out . println ( n ) ; for ( int i = 0 ; i < k ; i ++ ) { for ( int j = i ; j < n ; j += k ) { ans [ j ] = s . charAt ( i ) ; } } boolean less = false ; int idx = - 1 ; char cc = ' ▁ ' ; for ( int i = 0 ; i < n ; i ++ ) { if ( ans [ i ] > s . charAt ( i ) ) break ; if ( ans [ i ] < s . charAt ( i ) ) { less = true ; idx = i ; break ; } } if ( ! less ) System . out . println ( ans ) ; else { int min_idx = - 1 ; for ( int i = 0 ; i < k ; i ++ ) { if ( s . charAt ( i ) != '9' ) min_idx = i ; } min_idx = Math . min ( idx , min_idx ) ; for ( int i = min_idx ; i < k ; i ++ ) { for ( int j = i ; j < n ; j += k ) { if ( i == min_idx ) ans [ j ] = ( char ) ( s . charAt ( i ) + 1 ) ; else ans [ j ] = '0' ; } } System . out . println ( ans ) ; } }
(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: (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: (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) value: (method_invocation object: (identifier) name: (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))))) (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: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (character_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 (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (break_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (true))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (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 (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (decimal_integer_literal)))))) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))))