#include <bits/stdc++.h>
using namespace std;
inline long long add(long long a, long long b) {
  return ((a % 1000000007) + (b % 1000000007)) % 1000000007;
}
inline long long mul(long long a, long long b) {
  return ((a % 1000000007) * (b % 1000000007)) % 1000000007;
}
inline long long sub(long long a, long long b) {
  return ((a % 1000000007) - (b % 1000000007) + 1000000007) % 1000000007;
}
void printA(long long ans[], long long n) {
  for (long long i = 0; i < n; i++) {
    cout << ans[i];
  }
  return;
}
void Flash() {
  long long n, k;
  cin >> n >> k;
  string dig;
  cin >> dig;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    a[i] = dig[i] - '0';
  }
  long long ans[n];
  for (long long i = 0; i < k; i++) {
    ans[i] = a[i];
  }
  for (long long i = k; i < n; i++) {
    ans[i] = ans[i - k];
  }
  bool chk = true;
  for (long long i = k; i < n; i++) {
    if (ans[i] > a[i]) {
      chk = true;
      break;
    }
    if (a[i] > ans[i]) {
      chk = false;
      break;
    }
  }
  if (chk) {
    cout << n << "\n";
    printA(ans, n);
    return;
  }
  bool carry = false;
  ans[k - 1] = (a[k - 1] + 1);
  carry = (ans[k - 1] / 10);
  ans[k - 1] %= 10;
  long long itt = k - 2;
  while (carry && itt >= 0) {
    ans[itt] = (ans[itt] + 1);
    carry = (ans[itt] / 10);
    ans[itt] %= 10;
    --itt;
  }
  for (long long i = 0; i < k; i++) {
    ans[i] %= 10;
  }
  for (long long i = k; i < n; i++) {
    ans[i] = ans[i - k];
  }
  cout << n << "\n";
  printA(ans, n);
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  ;
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    Flash();
  }
  return 0;
}
