#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
inline int read() {
  int s = 0, w = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
int n, k;
char a[N];
int d[N], mark[N];
inline void Task0() {
  int p = 1;
  printf("%d\n", n);
  while (p <= n) {
    if (p % k)
      printf("%d", d[p % k]);
    else
      printf("%d", d[k]);
    p++;
  }
  puts("");
}
inline void Task2() {
  int p = k;
  if (d[p] == 9)
    d[p - 1]++, d[p] = 0;
  else
    d[p]++;
  p--;
  while (p >= 1) {
    if (d[p] == 10)
      d[p] = 0, d[p - 1]++;
    else
      break;
    p--;
  }
  p = 1;
  printf("%d\n", n);
  while (p <= n) {
    if (p % k)
      printf("%d", d[p % k], p);
    else
      printf("%d", d[k], p);
    p++;
  }
  puts("");
}
int main() {
  scanf("%d %d", &n, &k);
  scanf("%s", a + 1);
  for (register int i = 1; i <= n; i++) d[i] = a[i] - '0';
  if (n <= k) {
    printf("%d\n", n);
    puts(a + 1);
    return 0;
  }
  int flag = 1;
  for (register int i = 2; i <= n / k + 1; i++) {
    for (register int j = (i - 1) * k + 1; j <= i * k && j <= n; j++) {
      if (d[j] < d[j - k]) {
        flag = 0;
        break;
      }
      if (d[j] > d[j - k]) {
        flag = 2;
        break;
      }
    }
    if (flag == 0) {
      Task0();
      break;
    }
    if (flag == 2) {
      Task2();
      break;
    }
  }
  if (flag == 1) printf("%d\n", n), puts(a + 1);
  return 0;
}
