#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> a, b;
int main() {
  cin >> n >> k;
  a.resize(n);
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    char c;
    cin >> c;
    a[i] = c - '0';
  }
  for (int(i) = 0; (i) < (int)(n); (i)++) b.push_back(a[i % k]);
  if (b < a) {
    b.clear();
    a[k - 1] += 1;
    for (int i = k - 1; i >= 1; i--)
      if (a[i] == 10) a[i] = 0, a[i - 1] += 1;
    for (int(i) = 0; (i) < (int)(n); (i)++) {
      b.push_back(a[i % k]);
    }
  }
  cout << n << endl;
  for (int(i) = 0; (i) < (int)(b.size()); (i)++) cout << b[i];
  cout << endl;
  return 0;
}
