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