#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  string pref = s.substr(0, k);
  bool inc = 0;
  for (int i = k; i < n; i += k) {
    string x = s.substr(i, k);
    int c = pref.substr(0, x.size()).compare(x);
    if (c > 0) break;
    if (c < 0) {
      inc = true;
      break;
    }
  }
  if (inc) {
    for (int i = k - 1; i >= 0; --i) {
      s[i]++;
      if (s[i] == '9' + 1) {
        s[i] = '0';
      } else
        break;
    }
  }
  for (int i = k; i < n; ++i) s[i] = s[i % k];
  cout << n << "\n" << s;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
