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