#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e+9 + 7;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const long long MAXN = 1e+5 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long i, j, n, k;
  cin >> n >> k;
  string second, ans;
  cin >> second;
  ans = second;
  for (i = 0; i < k; ++i)
    for (j = i + k; j < n; j += k) ans[j] = ans[i];
  if (ans < second) {
    for (i = 0; i < k; ++i)
      if (ans[i] < second[i]) break;
    if (i == k) --i;
    while (second[i] == '9') --i;
    for (j = i + 1; j < k; ++j) ans[j] = '0';
    ans[i]++;
    for (i = 0; i < k; ++i)
      for (j = i + k; j < n; j += k) ans[j] = ans[i];
  }
  cout << n << '\n' << ans << '\n';
  return 0;
}
