#include <bits/stdc++.h>
using namespace std;
int caseno = 0;
bool sortbysec(pair<int, int> a, pair<int, int> b) {
  return a.second > b.second;
}
long long gc(long long a, long long b) {
  while (b) {
    long long x = a % b;
    a = b;
    b = x;
  }
  return a;
}
long long lc(long long a, long long b) { return a / gc(a, b) * b; }
const int primemod = 1e9 + 7;
const long double eps = 1e-9;
int n, k;
string s, ss;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> s;
  ss = s.substr(0, k);
  for (int i = k; i < n; i++) {
    ss += ss[i - k];
  }
  if (ss >= s) cout << ss.size() << endl << ss << endl, exit(0);
  for (int i = k - 1; i >= 0; i--) {
    if (ss[i] == '9') {
      ss[i] = '0';
    } else {
      ss[i]++;
      break;
    }
  }
  for (int i = k; i < n; i++) {
    ss[i] = ss[i - k];
  }
  cout << ss.size() << endl << ss << endl;
}
