#include <bits/stdc++.h>
using namespace std;
int read();
long long readll();
int n, m, a[1000009], b[1000009];
char ch[1000009];
bool check() {
  int i;
  for (i = 1; i <= n; i++)
    if (a[i] != b[i]) return a[i] < b[i];
  return 1;
}
void opt() {
  printf("%d\n", n);
  for (int i = 1; i <= n; i++) putchar('0' + b[i]);
  puts("");
}
int main() {
  scanf("%d%d%s", &n, &m, ch + 1);
  int i;
  for (i = 1; i <= n; i++) a[i] = ch[i] - '0';
  for (i = 1; i <= n; i++) b[i] = (i <= m ? a[i] : b[i - m]);
  if (check())
    opt();
  else {
    b[m]++;
    for (i = m; b[i] >= 10; i--) {
      b[i - 1]++;
      b[i] -= 10;
    }
    for (i = m + 1; i <= n; i++) b[i] = b[i - m];
    opt();
  }
  return 0;
}
int read() {
  int x = 0;
  char ch = getchar();
  bool flag = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return flag ? -x : x;
}
long long readll() {
  long long x = 0;
  char ch = getchar();
  bool flag = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return flag ? -x : x;
}
