#include <bits/stdc++.h>
using namespace std;
bool check(string s, int k) {
  for (size_t i = k; i < s.size(); ++i)
    if (s[i] > s[i % k])
      return false;
    else if (s[i] < s[i % k])
      return true;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  if (!check(s, k))
    for (int i = k - 1; s[i]++ == '9'; s[i--] = '0')
      ;
  cout << n << "\n";
  for (int i = 0; i < n; ++i) cout << s[i % k];
  return 0;
}
