#include <bits/stdc++.h>
using namespace std;
const int N = 200010, mod = 998244353;
int sz[N], n, m;
vector<long long> v;
long long ans1 = 0, ans2 = 0, ans3 = 0, a, b, c, mini;
int main(void) {
  int n, k;
  cin >> n >> k;
  string str;
  cin >> str;
  string str1 = str;
  for (int i = 0; i < n; i++) {
    if (i < k)
      str1[i] = str[i];
    else
      str1[i] = str1[i - k];
  }
  int ff = 0;
  for (int i = 0; i < n; i++) {
    if (str1[i] == str[i])
      continue;
    else if (str1[i] > str[i])
      break;
    else {
      ff = 1;
      break;
    }
  }
  if (!ff)
    cout << n << endl << str1 << endl;
  else {
    int pp = -1;
    for (int i = k - 1; i >= 0; i--) {
      if (str[i] != '9') {
        pp = i;
        break;
      }
    }
    if (pp == -1)
      str = '1' + str, pp = 0;
    else
      str[pp] = str[pp] + 1;
    for (int i = pp + 1; i < k; i++) str[i] = '0';
    for (int i = k; i < n; i++) str[i] = str[i - k];
    cout << str.size() << endl;
    cout << str;
  }
  return 0;
}
