#include <bits/stdc++.h>
using namespace std;
long long n, k, i, t;
int main() {
  t = 1;
  cin >> n >> k;
  string s;
  cin >> s;
  string tt = s;
  for (int i = 0; i < n; i++) {
    s[i] = s[i % k];
  }
  cout << s.size() << endl;
  if (s == tt) {
    cout << s << endl;
  } else if (s > tt) {
    cout << s << endl;
  } else {
    long long c = 1;
    for (i = k - 1; i >= 0; i--) {
      if (s[i] == '9') {
        s[i] = '0';
        continue;
      } else {
        s[i] = s[i] + 1;
        break;
      }
    }
    for (int i = 0; i < n; i++) {
      s[i] = s[i % k];
    }
    cout << s << endl;
  }
}
