#include <bits/stdc++.h>
using namespace std;
string max_case(int n) {
  string res = "";
  int curr = 1;
  for (int i = 0; i < n; ++i) {
    if (curr == 0)
      res += "0";
    else
      res += "1";
    curr = 1 ^ curr;
  }
  return res;
}
int find_start_idx(string& s, int k) {
  int res = k - 1;
  while (res >= 0 && s[res] == '9') res--;
  return res;
}
string solve(string& s, int n, int k, int start_idx) {
  string res = "";
  for (int i = 0; i < start_idx; ++i) res += s[i];
  res += s[start_idx] + 1;
  for (int i = start_idx + 1; i < k; ++i) res += '0';
  for (int i = k; i < n; ++i) {
    res += res[i - k];
  }
  return res;
}
string get_as_is(string& s, int n, int k) {
  string res = "";
  for (int i = 0; i < k; ++i) res += s[i];
  for (int i = k; i < n; ++i) res += res[i - k];
  return res;
}
int main() {
  int n, k;
  string s;
  cin >> n >> k;
  cin >> s;
  string as_is = get_as_is(s, n, k);
  if (strcmp(s.c_str(), as_is.c_str()) <= 0) {
    cout << n << '\n';
    cout << as_is << '\n';
    return 0;
  }
  int start_idx = find_start_idx(s, k);
  if (start_idx == 0 && s[0] == '9') {
    string sol = max_case(n + 1);
    cout << n + 1 << '\n';
    cout << sol << '\n';
  } else {
    string sol = solve(s, n, k, start_idx);
    cout << sol.size() << '\n';
    cout << sol << '\n';
  }
  return 0;
}
