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