#include <bits/stdc++.h>
using namespace std;
int gi() {
  char cc = getchar();
  int cn = 0, flus = 1;
  while (cc < '0' || cc > '9') {
    if (cc == '-') flus = -flus;
    cc = getchar();
  }
  while (cc >= '0' && cc <= '9') cn = cn * 10 + cc - '0', cc = getchar();
  return cn * flus;
}
const int N = 2e5 + 5;
int n, m, A[N], B[N], fl;
char s[N];
signed main() {
  n = gi(), m = gi();
  scanf("%s", s + 1);
  for (register int i = 1; i <= n; ++i) A[i] = s[i] - '0';
  for (register int i = 1; i <= m; ++i) B[i] = A[i];
  for (register int i = 1; i <= n; ++i) {
    int k = (i - 1) % m + 1;
    if (A[i] < B[k]) break;
    if (A[i] > B[k]) fl = 1;
  }
  if (fl) {
    for (register int i = m; i >= 1; --i) {
      if (B[i] < 9) {
        ++B[i];
        for (register int k = i + 1; k <= m; ++k) B[k] = 0;
        break;
      }
    }
  }
  printf("%d\n", n);
  for (register int i = 1; i <= n; ++i) {
    int k = (i - 1) % m + 1;
    printf("%d", B[k]);
  }
  return 0;
}
