#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string ans = s;
  for (int i = k; i < n; i++) {
    ans[i] = ans[i - k];
  }
  cout << n << "\n";
  if (ans >= s) {
    cout << ans;
    return 0;
  }
  int i = k - 1;
  for (; i >= 0; i--) {
    if (ans[i] < '9') {
      ans[i]++;
      break;
    }
  }
  i++;
  for (; i < k; i++) {
    ans[i] = '0';
  }
  for (i = k; i < n; i++) {
    ans[i] = ans[i - k];
  }
  cout << ans;
  return 0;
}
