#include <bits/stdc++.h>
using namespace std;
vector<int> x;
int n, k, cnt;
string s;
int main() {
  cin >> n >> k >> s;
  string t = s;
  for (int i = 0; i < s.size(); i++) {
    t[i] = s[i % k];
  }
  cout << n << endl;
  if (t >= s)
    cout << t << endl;
  else {
    s[k - 1]++;
    for (int i = k - 1; i >= 0; i--) {
      if (s[i] == '9' + 1) {
        s[i - 1]++;
        s[i] = '0';
      }
    }
    for (int i = 0; i < s.size(); i++) {
      t[i] = s[i % k];
    }
    cout << t << endl;
  }
  return 0;
}
