#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> a;
int main(int argc, char** argv) {
  scanf("%d%d", &n, &k);
  a.resize(n);
  char c;
  scanf("%c", &c);
  for (int i = 0; i < n; i++) {
    scanf("%c", &c);
    a[i] = c - '0';
  }
  for (int i = k; i < n; i++) {
    if (a[i % k] > a[i]) break;
    if (a[i % k] < a[i]) {
      int j = k - 1;
      while (j >= 0 && a[j] == 9) a[j] = 0, j--;
      a[j]++;
      break;
    }
  }
  printf("%d\n", n);
  for (int i = 0; i < n; i++) putchar(a[i % k] + '0');
  putchar('\n');
  return 0;
}
