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