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