#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, i, j = 0, c = 0;
  string a, b;
  cin >> n >> k;
  cin >> a;
  b.append(a, 0, k);
  for (j = 0; j < n; j++) {
    if (b[j % k] < a[j]) {
      c = 1;
      break;
    }
    if (b[j % k] > a[j]) {
      break;
    }
  }
  if (c != 1) {
    cout << n << endl;
    for (j = 0; j < n; j++) {
      cout << b[j % k];
    }
    return 0;
  } else {
    j = k - 1;
    c = 0;
    while (j >= 0) {
      if (b[j] != '9') {
        c++;
        break;
      }
      j--;
    }
    if (c == 0) {
      cout << n + 1 << endl;
      for (j = 0; j < n + 1; j++) {
        cout << "1";
      }
      return 0;
    } else {
      b[j] = b[j] + 1;
      j++;
      while (j < k) {
        b[j] = '0';
        j++;
      }
      cout << n << endl;
      for (j = 0; j < n; j++) {
        cout << b[j % k];
      }
    }
  }
}
