#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
int n, k;
char s[N], tmp[N];
int main() {
  scanf("%d %d", &n, &k);
  scanf("%s", s + 1);
  for (int i = 1; i <= k; i++) tmp[i] = s[i];
  for (int i = k + 1; i <= n; i++) tmp[i] = tmp[i - k];
  int flag = 1;
  for (int i = 1, bo = 0; i <= n; i++) {
    if (tmp[i] > s[i]) bo = 1;
    if (tmp[i] < s[i] && !bo) flag = 0;
  }
  if (flag) {
    printf("%d\n%s", n, tmp + 1);
    return 0;
  }
  for (int i = k; i >= 1; i--) {
    if (tmp[i] == '9') {
      tmp[i] = '0';
    } else {
      tmp[i]++;
      break;
    }
  }
  for (int i = k + 1; i <= n; i++) tmp[i] = tmp[i - k];
  printf("%d\n%s", n, tmp + 1);
  return 0;
}
