#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, pos, pos2;
  cin >> n >> k;
  char s[n];
  cin >> s;
  pos = n, pos2 = n;
  bool f = 0;
  for (int i = 0; i < k; i++) {
    for (int j = i + k; j < n; j += k) {
      if (s[j] > s[i]) {
        pos2 = min(pos2, j);
        break;
      } else if (s[j] < s[i]) {
        pos = min(pos, j);
        break;
      }
    }
  }
  cout << n << "\n";
  if (pos <= pos2) {
    for (int i = 0; i < n; i++) {
      cout << s[(i) % k];
    }
  } else {
    vector<char> v;
    int j = k - 1;
    while (j >= 0) {
      if (s[j] == '9')
        v.push_back('0'), j--;
      else
        break;
    }
    v.push_back(s[j] + 1);
    for (int i = j - 1; i >= 0; i--) v.push_back(s[i]);
    reverse(v.begin(), v.end());
    for (int i = 0; i < n; i++) {
      cout << v[i % k];
    }
  }
}
