#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, k;
  cin >> n >> k;
  string h;
  cin >> h;
  cout << n << '\n';
  string ans = h.substr(0, k);
  for (long long i = k; i < n; i++) ans += ans[i - k];
  if (ans >= h) {
    cout << ans << '\n';
    return 0;
  }
  for (long long i = k - 1; i >= 0; i--) {
    if (ans[i] == '9')
      ans[i] = '0';
    else {
      ans[i]++;
      break;
    }
  }
  for (long long i = k; i < n; i++) ans[i] = ans[i - k];
  cout << ans << '\n';
  return 0;
}
