#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<int> a(n);
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    a[i] = s[i] - '0';
  }
  for (int i = 0; i < n; ++i) {
    int id = i % k;
    if (a[i] != a[id]) {
      if (a[i] > a[id]) ok = false;
      break;
    }
  }
  cout << n << '\n';
  if (!ok) {
    for (int j = k - 1; j >= 0; --j) {
      if (a[j] < 9) {
        ++a[j];
        for (int i = j + 1; i < n; ++i) a[i] = 0;
        break;
      }
    }
  }
  for (int i = 0; i < n; ++i) cout << a[i % k];
  return 0;
}
