#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  string str, ans;
  int n, k;
  cin >> n >> k;
  cin >> str;
  ans = str;
  for (int i = k; i < n; i++) ans[i] = ans[i - k];
  if (str <= ans) {
    cout << ans.length() << endl;
    cout << ans;
    return;
  }
  for (int i = k - 1; i >= 0; i--) {
    if (ans[i] != '9') {
      int temp = ans[i] - '0';
      ans[i] = (char)(temp + 1 + '0');
      while (++i < k) ans[i] = '0';
      break;
    }
  }
  for (int i = k; i < n; i++) ans[i] = ans[i - k];
  cout << ans.length() << endl;
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
