#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  string s, s1;
  cin >> s;
  s1 = s;
  char c;
  bool b = true;
  for (long long int i = 0; i < k; i++) {
    c = s[i];
    for (long long int j = i; j < n; j += k) {
      s1[j] = c;
    }
  }
  for (long long int i = 0; i < n; i++) {
    if (s[i] != s1[i]) {
      if (s[i] > s1[i]) b = false;
      break;
    }
  }
  if (!b) {
    for (long long int i = k - 1; i >= 0; i--) {
      if (s1[i] != '9') {
        c = s1[i] + 1;
        for (long long int j = i; j < n; j += k) s1[j] = c;
        b = true;
        break;
      } else {
        for (long long int j = i; j < n; j += k) s1[j] = '0';
      }
    }
    if (b) cout << n << "\n" << s1 << "\n";
  } else
    cout << n << "\n" << s1 << "\n";
  return 0;
}
