#include <bits/stdc++.h>
using namespace std;
int n, k;
string x, y;
void update(int loc) {
  if (y[loc] == '9') {
    update(loc - 1);
    for (int i = loc; i < n; i += k) y[i] = '0';
    return;
  }
  for (int i = loc; i < n; i += k) ++y[i];
}
int main() {
  cin >> n >> k >> x;
  for (int i = 0; i < k; ++i) y.push_back(x[i]);
  for (int i = k; i < n; ++i) y.push_back(y[i - k]);
  cout << n << "\n";
  if (y < x) update(k - 1);
  cout << y;
  return 0;
}
