#include <bits/stdc++.h>
using namespace std;
int main() {
  std::cout << std::fixed;
  std::cout << std::setprecision(10);
  long long t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    string s1 = s;
    for (long long i = k; i < n; i++) {
      s1[i] = s1[i - k];
    }
    cout << n << endl;
    if (s1 >= s) {
      cout << s1 << endl;
    } else {
      for (long long i = k - 1; i >= 0; i--) {
        if (s1[i] == '9') {
          s1[i] = '0';
        } else {
          s1[i] = s1[i] + 1;
          break;
        }
      }
      for (long long i = k; i < n; i++) s1[i] = s1[i - k];
      cout << s1 << endl;
    }
  }
}
