#include <bits/stdc++.h>
using namespace std;
namespace longbeautiful {
int n;
int k;
int a[200100];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
  }
  bool works = true;
  for (int i = k; i < n; i++) {
    if (a[i] > a[i - k]) {
      works = false;
      break;
    }
    if (a[i] < a[i - k]) {
      works = true;
      break;
    }
  }
  if (works) {
    cout << n << endl;
    for (int i = 0; i < n; i++) {
      cout << a[i % k] << "";
    }
    cout << endl;
  } else {
    cout << n << endl;
    for (int i = k - 1; i >= 0; i--) {
      a[i] += 1;
      if (a[i] < 10) {
        break;
      }
      a[i] = 0;
    }
    for (int i = 0; i < n; i++) {
      cout << a[i % k] << "";
    }
  }
  return 0;
}
}  // namespace longbeautiful
int main() {
  longbeautiful::main();
  return 0;
}
