#include <bits/stdc++.h>
using namespace std;
string s;
int n, k;
int main() {
  cin >> n >> k;
  cin >> s;
  cout << n << endl;
  int first_bad = -1;
  for (int i = 0; i < s.size(); i++) {
    if (i < k) {
      continue;
    }
    char prv = s[i - k];
    if (s[i] != prv) {
      first_bad = i;
      break;
    }
  }
  if (first_bad == -1) {
    cout << s << endl;
    return 0;
  }
  if (s[first_bad] < s[first_bad - k]) {
    for (int i = first_bad; i < s.size(); i++) {
      s[i] = s[i - k];
    }
    cout << s << endl;
    return 0;
  } else {
    int ps = k - 1;
    while (s[ps] == '9') {
      s[ps] = '0';
      ps--;
    }
    s[ps]++;
    for (int i = ps + 1; i < s.size(); i++) {
      if (i >= k) {
        s[i] = s[i - k];
      }
    }
    cout << s << endl;
  }
  return 0;
}
