#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 7, oo = 1e18, mod = 1e9 + 7;
long long n, k, pos, tmppos;
string s, xx = " ";
char x[maxn];
bool check() {
  for (long long i = (1); i <= (n); ++i)
    if (x[i] < s[i])
      return false;
    else if (x[i] > s[i])
      return true;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> s;
  s = " " + s;
  x[0] = ' ';
  for (long long i = (1); i <= (k); ++i) x[i] = s[i];
  for (long long i = (k + 1); i <= (n); ++i) x[i] = x[i - k];
  if (check()) {
    cout << n << '\n';
    for (long long i = (1); i <= (n); ++i) cout << x[i];
    return 0;
  }
  for (long long i = (k); i >= (1); --i) {
    if (x[i] == '9')
      x[i] = '0';
    else {
      ++x[i];
      break;
    }
  }
  for (long long i = (k + 1); i <= (n); ++i) x[i] = x[i - k];
  cout << n << '\n';
  for (long long i = (1); i <= (n); ++i) cout << x[i];
}
