#include <bits/stdc++.h>
using namespace std;
int n, k;
char a[200005], b[200005];
int main() {
  cin >> n >> k;
  getchar();
  for (int i = 1; i <= n; ++i) {
    a[i] = getchar();
    if (i <= k) b[i] = a[i];
  }
  bool gg = 0, flag = 0;
  b[0] = b[k];
  for (int i = 1; i <= n; ++i) {
    if (b[i % k] - a[i] > 0) gg = 1;
    if (!gg and b[i % k] - a[i] < 0) {
      flag = 1;
      break;
    }
  }
  if (!flag) {
    cout << n << endl;
    for (int i = 1; i <= n; ++i) {
      cout << (i % k == 0 ? b[k] : b[i % k]);
    }
  } else {
    b[k] += 1;
    bool wil = 0;
    if (b[k] - '0' == 10) {
      wil = 1;
      b[k] = '0';
    }
    if (wil) {
      for (int i = k - 1; i; --i) {
        if (wil) wil = 0, b[i] += 1;
        if (b[i] - '0' == 10) {
          wil = 1;
          b[i] = '0';
        } else
          break;
      }
    }
    cout << n << endl;
    for (int i = 1; i <= n; ++i) {
      cout << (i % k == 0 ? b[k] : b[i % k]);
    }
  }
}
