#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  long long a[n], flag = 0;
  string str;
  cin >> str;
  for (long long i = 0; i < str.length(); i++) a[i] = str[i] - '0';
  string s = {};
  for (long long i = 0; i < str.length(); i++) {
    s += a[i % k] + '0';
  }
  if (s >= str) {
    cout << s.length() << endl;
    cout << s;
  } else {
    for (int i = k - 1; i >= 0; i--)
      if (s[i] == '9')
        s[i] = '0';
      else {
        s[i] = s[i] + 1;
        break;
      }
    for (long long i = 0; i < str.length(); i++) s[i] = s[i % k];
    cout << s.length() << endl;
    cout << s;
  }
  return 0;
}
