#include <bits/stdc++.h>
using namespace std;
string a, b;
int main() {
  long long i, n, t, k, j, x = 0, y = 0, m;
  scanf("%I64d %I64d", &n, &k);
  cin >> a;
  b = a;
  for (i = 0; i < k; i++) {
    b[i] = a[i];
  }
  for (i = k; i < n; i++) b[i] = b[i - k];
  if (b >= a) {
    cout << b.size() << endl;
    cout << b << endl;
    return 0;
  }
  for (i = k - 1; i >= 0; i--) {
    if (b[i] == '9') {
      b[i] = '0';
    } else {
      b[i] = b[i] + 1;
      break;
    }
  }
  for (i = k; i < n; i++) b[i] = b[i - k];
  cout << b.size() << endl;
  cout << b << endl;
  return 0;
}
