#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, mod = 998244353;
const long long inf = 1e18;
template <typename A, typename B>
ostream& operator<<(ostream& out, pair<A, B> p) {
  out << "{ " << p.first << ", " << p.second << " }";
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> v) {
  out << "[ ";
  for (int i = 0; i < int((v).size()); i++) {
    out << v[i];
    if (i != int((v).size()) - 1) out << " ,";
  }
  out << " ]";
  return out;
}
string build(string s, int k, int n) {
  string ans;
  for (int i = 0; i < n; i++) ans += s[i % k];
  return ans;
}
bool bad(string s) {
  for (char ch : s)
    if (ch != '9') return 0;
  return 1;
}
string next(string s) {
  int pt = int((s).size()) - 1;
  while (s[pt] == '9') {
    s[pt] = '0';
    pt--;
  }
  s[pt] = s[pt] + 1;
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie();
  int n, k;
  string s;
  cin >> n >> k >> s;
  string ans = build(s.substr(0, k), k, n);
  if (ans >= s) {
    return cout << n << endl << ans << endl, 0;
  }
  if (bad(s.substr(0, k))) {
    ans = "1";
    for (int i = 0; i < k - 1; i++) ans += '0';
    return cout << n + 1 << endl << build(ans, k, n + 1) << endl, 0;
  }
  return cout << n << endl << build(next(s.substr(0, k)), k, n) << endl, 0;
}
