#include <bits/stdc++.h>
using namespace std;
int n, k, ct;
string num, temp;
int main() {
  cin >> n >> k >> num;
  for (int i = 0; i < n; i++) temp += num[i % k];
  if (temp < num)
    for (int i = k - 1; ++temp[i] > '9'; i--) temp[i] = '0';
  for (int i = 0; i < n; i++) temp[i] = temp[i % k];
  cout << n << endl << temp << endl;
}
