#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  if (y == 0)
    return 1;
  else {
    long long int p = power(x, y / 2);
    if (y % 2 == 0)
      return (p * p) % 1000000007LL;
    else
      return (x * ((p * p) % 1000000007LL)) % 1000000007LL;
  }
}
long long int gcd(long long int x, long long int y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  long long int n, p = 0, k, f = 0, c = 0, d = 0, g = 0;
  cin >> n >> k;
  string s;
  cin >> s;
  for (int j = k; j <= n - 1; j++) {
    if (s[j] < s[j % k])
      g++;
    else if (s[j] > s[j % k])
      f++;
    if (f == 1)
      break;
    else if (g == 1)
      break;
  }
  if (f) {
    string t;
    int c = 1;
    for (int i = k - 1; i >= 0; i--) {
      c = c + s[i] - '0';
      if (c <= 9) {
        t = t + char(c + '0');
        c = 0;
      } else {
        t = t + char(c - 10 + '0');
        c = 1;
      }
    }
    reverse(t.begin(), t.end());
    if (c == 0) {
      cout << s.length() << "\n";
      for (int i = 0; i < n / k; i++) cout << t;
      cout << t.substr(0, n % k);
    }
    if (c == 1) {
      cout << n << "\n";
      for (int i = 0; i < n; i++) cout << 9;
    }
  } else if (g) {
    cout << s.length() << "\n";
    for (int i = 0; i < n; i++) s[i] = s[i % k];
    cout << s;
  } else {
    cout << s.length() << "\n" << s;
  }
}
