#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s, t;
  int n, k, f = 0;
  cin >> n >> k;
  cin >> s;
  t = s;
  for (int i = 0; i < k; i++) {
    t[i] = s[i];
  }
  for (int i = k; i < n; i++) {
    t[i] = t[i - k];
  }
  cout << t.size() << endl;
  if (t >= s) {
    cout << t << endl;
  } else {
    for (int i = k - 1; i >= 0; i--) {
      if (t[i] == '9') {
        for (int j = i; j < n; j += k) {
          t[j] = '0';
        }
      } else {
        for (int j = i; j < n; j += k) {
          t[j]++;
        }
        break;
      }
    }
    cout << t << endl;
  }
}
