#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); }
long long LCM(long long a, long long b) { return a * (b / GCD(a, b)); }
char s[200005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  scanf("%s", s);
  bool f = false;
  int x = n;
  for (int i = 0, j = k; j < n; i++, j++) {
    if (s[i] > s[j]) {
      if (x == n) x = j;
      s[j] = s[i];
    } else if (s[i] < s[j]) {
      if (x < j)
        s[j] = s[i];
      else {
        for (int p = k - 1; p >= 0; p--) {
          if (s[p] == '9') {
            s[p] = '0';
          } else {
            s[p] = s[p] + 1;
            break;
          }
        }
        break;
      }
    }
  }
  for (int i = 0, j = k; j < n; i++, j++) {
    s[j] = s[i];
  }
  printf("%d\n%s\n", n, s);
  return 0;
}
