#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string ans = s;
  long long i = k;
  while (i < n) {
    ans[i] = ans[i - k];
    i++;
  }
  bool small = false;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] > ans[i]) {
      small = true;
      break;
    } else if (s[i] < ans[i])
      break;
  }
  if (small) {
    long long carry = 1;
    for (long long j = k - 1; j >= 0; j--) {
      if (ans[j] == '9') {
      } else {
        ans[j] = ans[j] + 1;
        j++;
        while (j < k) {
          ans[j] = '0';
          j++;
        }
        break;
      }
    }
    long long j = k;
    while (j < ans.size()) {
      ans[j] = ans[j - k];
      j++;
    }
  }
  cout << ans.size() << endl;
  cout << ans << endl;
  return 0;
}
