#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
mt19937 gen(228);
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string new_s;
  for (int i = 0; i < n; i++) {
    new_s += s[i % k];
  }
  if (new_s < s) {
    for (int i = k - 1; i >= 0; i--) {
      if (new_s[i] != '9') {
        new_s[i]++;
        for (int j = i + 1; j < k; j++) {
          new_s[j] = '0';
        }
        break;
      }
    }
    for (int i = k; i < n; i++) {
      new_s[i] = new_s[i - k];
    }
  }
  cout << n << "\n" << new_s << "\n";
  return 0;
}
