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