#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
bool iseven(long long int n) {
  if ((n & 1) == 0) return true;
  return false;
}
void print(long long int t) { cout << t; }
void print(int t) { cout << t; }
void print(string t) { cout << t; }
void print(char t) { cout << t; }
void print(double t) { cout << t; }
void print(long double t) { cout << t; }
template <class T, class V>
void print(pair<T, V> p);
template <class T>
void print(vector<T> v);
template <class T>
void print(set<T> v);
template <class T, class V>
void print(map<T, V> v);
template <class T>
void print(multiset<T> v);
template <class T, class V>
void print(pair<T, V> p) {
  cout << "{";
  print(p.first);
  cout << ",";
  print(p.second);
  cout << "}";
}
template <class T>
void print(vector<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void print(set<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void print(multiset<T> v) {
  cout << "[ ";
  for (T i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T, class V>
void print(map<T, V> v) {
  cout << "[ ";
  for (auto i : v) {
    print(i);
    cout << " ";
  }
  cout << "]";
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string ans = "";
  for (long long int i = 0; i < k; ++i) {
    ans.push_back(s[i]);
  }
  bool flag = true;
  for (long long int i = k; i < n; ++i) {
    if (ans[i % k] > s[i]) {
      break;
    }
    if (ans[i % k] < s[i]) {
      flag = false;
      break;
    }
  }
  if (!flag) {
    long long int ptr = k - 1;
    while (ans[ptr] == '9') {
      ans[ptr] = '0';
      ptr--;
    }
    long long int num = ans[ptr] - '0';
    num++;
    char ch = num + '0';
    ans[ptr] = ch;
  }
  string original = ans;
  while (ans.size() < n) {
    ans += original;
  }
  while (ans.size() != n) {
    ans.pop_back();
  }
  cout << n << '\n' << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
