#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string out, in;
  cin >> in;
  out = in;
  for (int i = 0; i < k; i++) {
    out[i] = in[i];
  }
  for (int i = k; i < n; i++) {
    out[i] = out[i - k];
  }
  if (out >= in) {
    cout << n << endl;
    cout << out << endl;
  } else {
    for (int i = k - 1; i >= 0; i--) {
      if (out[i] != '9') {
        out[i] = out[i] + 1;
        break;
      }
      out[i] = '0';
    }
    for (int i = k; i < n; i++) {
      out[i] = out[i - k];
    }
    cout << n << endl;
    cout << out << endl;
  }
}
