#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  string s;
  cin >> s;
  string ans;
  for (int i = 0; i < N; i++) {
    ans += s[i % K];
  }
  if (ans >= s) {
    cout << N << endl << ans << endl;
    return 0;
  }
  int carry = 1, i = K - 1;
  while (carry > 0) {
    if (s[i] < '9') {
      ans[i]++;
      carry = 0;
    } else
      ans[i] = '0', i--;
  }
  for (int i = 0; i < N; i++) {
    ans[i] = ans[i % K];
  }
  cout << N << endl << ans << endl;
  return 0;
}
