#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long m, long long mod) {
  long long ans = 1;
  while (m) {
    if (m % 2) {
      ans *= a;
      ans %= (mod);
    }
    a = (a * a) % (mod);
    m >>= 1;
  }
  return ans;
}
void init(long long* a, long long n, long long val) {
  for (long long i = 0; i < n; i++) a[i] = val;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1, i, j;
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  char s1[s.length()];
  for (i = 0; i < k; i++) {
    for (j = i; j < n; j += k) {
      s1[j] = s[i];
    }
  }
  for (i = k; i < n; i++) {
    if (s1[i] - s[i] > 0) {
      cout << n << endl;
      for (i = 0; i < n; i++) cout << s1[i];
      return 0;
    }
    if (s1[i] - s[i] < 0) break;
  }
  if (i == n) {
    cout << n << endl;
    for (i = 0; i < n; i++) cout << s1[i];
    return 0;
  }
  for (i = k - 1; i > -1; i--) {
    if (s1[i] != '9') {
      s1[i]++;
      break;
    }
    s1[i] = '0';
  }
  for (i = 0; i < k; i++) {
    for (j = i; j < n; j += k) {
      s1[j] = s1[i];
    }
  }
  cout << n << endl;
  for (i = 0; i < n; i++) cout << s1[i];
  return 0;
}
