#include <bits/stdc++.h>
using namespace std;
vector<long long int> v1, v2;
vector<char> v4;
string s1, s2, s3;
long long int visited[2000005];
set<char> st;
set<long long int>::iterator it;
int main() {
  long long int a, b, c, d, e, f, i, j, k,
      cnt1 = 0, cnt2 = 0, sum1 = 0, sum2 = 0, first, chk1 = 0, chk2 = 0, T;
  cin >> a >> b;
  char xx;
  long long int indx, chk = 0;
  cin >> s1;
  s2 = s1;
  for (i = 0; i < a; i++) {
    if (visited[i] == 0) {
      v1.push_back(i);
      for (j = i; j < a; j += b) {
        visited[j] = 1;
        s1[j] = s1[i];
      }
    }
  }
  for (i = 0; i < a; i++) {
    if (s1[i] > s2[i]) {
      chk = 1;
      for (j = 0; j < v1.size(); j++) {
        if (v1[j] > i) {
          for (int k = v1[j]; k < a; k += b) {
            s1[k] = '0';
          }
        }
      }
      break;
    } else if (s1[i] == s2[i])
      cnt1++;
    else {
      first = i;
      break;
    }
  }
  if (cnt1 == a) chk = 1;
  if (chk == 0) {
    long long int x = upper_bound(v1.begin(), v1.end(), first) - v1.begin();
    x--;
    xx = s1[v1[x]];
    if (xx == '9') {
      for (i = x - 1; i >= 0; i--) {
        if (s1[v1[i]] != '9') {
          xx = s1[v1[i]] + 1;
          for (j = v1[i]; j < a; j += b) {
            s1[j] = xx;
          }
          for (j = i + 1; j < v1.size(); j++) {
            if (s1[v1[j]] != '0') {
              for (int k = v1[j]; k < a; k += b) {
                s1[k] = '0';
              }
            }
          }
          break;
        }
      }
    } else {
      for (i = v1[x]; i < a; i += b) {
        s1[i] = xx + 1;
      }
    }
  }
  cout << s1.size() << endl;
  cout << s1 << endl;
  return 0;
}
