#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, flag = -1, nb = 0;
  cin >> n >> k;
  string s1, s2;
  cin >> s1;
  s2 = s1;
  for (int i = 0; i < n - k; i++) {
    if (s1[i] != s1[i + k]) nb = 1;
  }
  if (nb == 0) {
    cout << s1.size() << "\n" << s1 << "\n";
    return 0;
  }
  for (int i = k; i < n; i++) {
    s2[i] = s1[i % k];
  }
  int j = k - 1;
  for (int i = 0; i < n; i++) {
    if (s2[i] > s1[i]) {
      flag = 1;
      break;
    }
    if (s2[i] < s1[i]) {
      flag = 0;
      break;
    }
  }
  if (flag == 0) {
    while (s1[j] == '9') {
      s2[j] = '0';
      j--;
    }
    s2[j]++;
    for (int i = k; i < n; i++) s2[i] = s2[i % k];
  }
  cout << n;
  cout << "\n" << s2 << "\n";
  return 0;
}
