#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 7;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
string s;
string findSum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  long long n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  long long carry = 0;
  for (long long i = 0; i < n1; i++) {
    long long sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (long long i = n1; i < n2; i++) {
    long long sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
bool chk(string ans, string a2) { return ans >= a2; }
void solve() {
  long long n, m;
  cin >> n >> m >> s;
  cout << n << '\n';
  string to_rep = s.substr(0, m);
  long long cnt = ceil(1.0 * n / m);
  string n_str = "";
  for (long long i = 0; i < cnt; i++) {
    n_str += to_rep;
  }
  long long cur = n_str.size();
  for (long long i = cur - 1; i >= n; i--) {
    n_str.pop_back();
  }
  if (chk(n_str, s))
    cout << n_str << '\n';
  else {
    to_rep = findSum(to_rep, "1");
    n_str = "";
    for (long long i = 0; i < cnt; i++) {
      n_str += to_rep;
    }
    cur = n_str.size();
    for (long long i = cur - 1; i >= n; i--) {
      n_str.pop_back();
    }
    cout << n_str << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  clock_t beg = clock();
  long long t = 1;
  while (t--) {
    solve();
  }
  cerr << "\nExecution time: " << (clock() - beg) / 1000 << '\n';
}
