#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  string s, ans;
  cin >> n >> k;
  cin >> s;
  ans = s;
  int flag = 0;
  for (int i = k; i < n; i++) {
    s[i] = s[i - k];
  }
  if (s < ans) {
    int x = k - 1;
    while (s[x] == '9') {
      s[x] = '0';
      x--;
    }
    s[x] += 1;
    for (int j = k; j < n; j++) {
      s[j] = s[j - k];
    }
  }
  cout << n << endl;
  cout << s << endl;
}
