#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 177;
char s[maxn], now[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    now[i] = s[i % m];
  }
  if (strcmp(now, s) >= 0) {
    printf("%d\n", n);
    printf("%s\n", now);
    return 0;
  }
  for (int i = m - 1; i >= 0; i--) {
    if (s[i] == '9') {
      s[i] = '0';
    } else {
      s[i]++;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    now[i] = s[i % m];
  }
  printf("%d\n", strlen(now));
  printf("%s\n", now);
}
