#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long N, K;
  string X;
  cin >> N >> K;
  cin >> X;
  string foo = X;
  for (long long i = 0; i + K < foo.size(); i++) {
    foo[i + K] = foo[i];
  }
  if (foo >= X) {
    cout << foo.size() << endl;
    cout << foo << endl;
    return;
  }
  string bar = foo.substr(0, K);
  bool all_nine = true;
  for (auto it : bar)
    if (it != '9') {
      all_nine = false;
      break;
    }
  if (all_nine) {
    cout << N + 1 << endl;
    for (long long i = 0; i < (N + 1); i++) {
      if (i % K == 0)
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
    return;
  }
  for (long long i = 0; i < (bar.size()); i++) {
    if (bar[bar.size() - i - 1] == '9') {
      bar[bar.size() - i - 1] = '0';
    } else {
      bar[bar.size() - i - 1] += 1;
      break;
    }
  }
  cout << N << endl;
  ;
  for (long long i = 0; i < (N); i++) cout << bar[i % K];
  cout << endl;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  cout << fixed;
  solve();
  return 0;
}
