#include <bits/stdc++.h>
using namespace std;
string findSum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  int n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  int carry = 0;
  for (int i = 0; i < n1; i++) {
    int sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n1; i < n2; i++) {
    int sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int r = 0;
  string s1 = s;
  for (int i = 0; i < n; i++) {
    s[i] = s[i % k];
  }
  r = 0;
  for (int i = 0; i < n - k; i++) {
    if (s[i] != s[i + k]) {
      r = 1;
    }
  }
  if (r == 0 && s >= s1) {
    cout << s.size() << endl;
    cout << s << endl;
  } else {
    string str;
    for (int i = 0; i < n; i++) {
      if (i % k == k - 1) {
        str.append(to_string(1));
      } else {
        str.append(to_string(0));
      }
    }
    string ans = findSum(s, str);
    for (int i = 0; i < n; i++) {
      ans[i] = ans[i % k];
    }
    cout << ans.size() << endl;
    cout << ans << endl;
  }
}
