#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  string x, y;
  cin >> x;
  string adding = x.substr(0, k);
  while (y.size() < x.size()) {
    y += adding;
  }
  y = y.substr(0, n);
  for (int i = 0; i < n; i++) {
    if (x[i] == y[i]) continue;
    if (x[i] > y[i]) {
      adding = x.substr(0, k);
      int t = k - 1;
      adding[k - 1]++;
      while (adding[t] == '0' + 10) {
        adding[t] = '0';
        adding[t - 1]++;
        t--;
      }
      y = "";
      while (y.size() < x.size()) {
        y += adding;
      }
      y = y.substr(0, n);
    }
    break;
  }
  cout << y.size() << '\n';
  cout << y;
}
