#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 2e5 + 7;
const int M = 1e9 + 7;
const int FFTM = 998244353;
int n, k;
string s;
string t;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  cin >> s;
  t = s;
  for (int i = 0; i < k; ++i) t[i] = s[i];
  for (int i = k; i < n; ++i) t[i] = t[i - k];
  cerr << t << '\n';
  if (t >= s) {
    cout << n << '\n' << t;
    return 0;
  }
  for (int i = k - 1; i >= 0; --i) {
    if (s[i] != '9') {
      for (int j = i; j < n; j += k) t[j]++;
      break;
    } else {
      for (int j = i; j < n; j += k) t[j] = '0';
    }
  }
  cout << n << '\n' << t;
  return 0;
}
