#include <bits/stdc++.h>
using namespace std;
const long long int sz = 100005;
const long long int szz = 1000006;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    string t;
    for (long long int i = 0; i < k; i++) {
      t += s[i];
    }
    for (long long int i = k; i < n; i++) {
      t += t[i - k];
    }
    if (t >= s) {
      cout << n << "\n" << t << "\n";
    } else {
      for (long long int i = k - 1; i >= 0; i--) {
        if (t[i] == '9')
          t[i] = '0';
        else {
          t[i]++;
          break;
        }
      }
      for (long long int i = k; i < n; i++) {
        t[i] = t[i - k];
      }
      cout << t.size() << "\n" << t << "\n";
    }
  }
}
