#include <bits/stdc++.h>
using namespace std;
char s[200005];
char a[200005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", s);
  a[n] = '\0';
  for (int i = 0; i < n; i++) a[i] = s[i % k];
  if (strcmp(s, a) > 0) {
    bool g = true;
    int g0 = k - 1;
    while (g) {
      if (a[g0] == '9') {
        a[g0] = '0';
        g0--;
      } else {
        g = false;
        a[g0]++;
      }
    }
    for (int i = k; i < n; i++) a[i] = a[i % k];
  }
  printf("%d\n", n);
  printf("%s\n", a);
  return 0;
}
