#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  int n, k, j;
  cin >> n >> k >> s;
  bool c = false;
  for (int i = k; i < n; ++i) {
    if (s[i] != s[i - k]) {
      if (s[i] < s[i - k]) {
        s[i] = s[i - k];
        c = true;
      } else {
        if (c) {
          s[i] = s[i - k];
        } else {
          j = k - 1;
          while (s[j] == '9') {
            --j;
          }
          ++s[j];
          for (int h = j + 1; h < k; ++h) {
            s[h] = '0';
          }
          i = k - 1;
          c = true;
        }
      }
    }
  }
  cout << n << '\n';
  cout << s << '\n';
  return 0;
}
