#include <bits/stdc++.h>
using namespace std;
int len, k;
string str;
int main() {
  cin >> len >> k;
  cin >> str;
  cout << len << endl;
  string ans = "";
  for (int i = 0; i < len; i++) {
    ans += str[i % k];
  }
  if (ans < str) {
    for (int i = k - 1; i >= 0; i--) {
      if (str[i] == '9') {
        str[i] = '0';
      } else {
        str[i] += 1;
        break;
      }
    }
  }
  ans = "";
  for (int i = 0; i < len; i++) {
    ans += str[i % k];
  }
  cout << ans << endl;
  return 0;
}
