#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, k;
  cin >> n >> k;
  string x;
  cin >> x;
  string y = x;
  for (long long int i = k; i < n; i++) y[i] = y[i - k];
  if (y < x) {
    long long int j = k - 1;
    while (y[j] == '9') {
      y[j] = '0';
      j--;
    }
    y[j] += 1;
    for (long long int i = k; i < n; i++) y[i] = y[i - k];
  }
  cout << n << endl;
  cout << y << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  solve();
  return 0;
}
