#include <bits/stdc++.h>
using namespace std;
int main(void) {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  };
  int n, k, i, j;
  cin >> n >> k;
  string s;
  cin >> s;
  string str = s;
  for (i = k; i < n; i++) {
    str[i] = str[i - k];
  }
  if (str >= s) {
    cout << str.size() << endl;
    cout << str << endl;
  } else {
    i = k - 1;
    while (s[i] == '9') {
      s[i] = '0';
      i--;
    }
    s[i]++;
    for (i = k; i < n; i++) {
      s[i] = s[i - k];
    }
    cout << s.size() << endl;
    cout << s;
  }
}
