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