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