#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string s1 = s;
  for (long long int i = k; i < n; i++) {
    s1[i] = s1[i - k];
  }
  if (s1 >= s) {
    cout << n << "\n";
    cout << s1;
    return 0;
  }
  for (long long int i = k - 1; i >= 0; i--) {
    if (s[i] != '9') {
      ++s[i];
      break;
    } else {
      s[i] = '0';
    }
  }
  for (long long int i = k; i < n; i++) {
    s[i] = s[i - k];
  }
  cout << n << "\n";
  cout << s;
  return 0;
}
