#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, i, j, x, k;
  cin >> n >> k;
  string s, t;
  cin >> s;
  t = s;
  for (i = 0; i < n; i++) {
    if (i - k >= 0) t[i] = t[i - k];
  }
  if (t > s) {
    cout << n << "\n" << t;
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (s[i] > t[i]) {
      for (j = k - 1; j >= 0; j--) {
        if (t[j] != '9') break;
      }
      for (; j < n; j += k) t[j]++;
      break;
    }
  }
  for (j = 0; j < k; j++)
    if (s[j] < t[j]) break;
  for (i = j + 1; i < k; i++) {
    for (long long p = i; p < n; p += k) t[p] = '0';
  }
  cout << n << "\n" << t;
}
