#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y);
long long gcd(long long a, long long b);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  string a;
  cin >> a;
  string b = a;
  for (int i = k; i < n; i++) b[i] = a[i % k];
  if (b >= a)
    cout << n << "\n" << b << "\n";
  else {
    for (int i = k - 1; i >= 0; i--)
      if (b[i] == '9')
        b[i] = '0';
      else {
        b[i] = b[i] + 1;
        break;
      }
    for (int i = k; i < n; i++) b[i] = b[i % k];
    cout << n << "\n" << b << "\n";
  }
  return 0;
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
