#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
void init() {
  iostream::sync_with_stdio(false);
  cout << fixed << setprecision(20);
}
void solve() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int ok = 1;
  for (int i = 0; i < n - k; ++i) {
    if (s[i] != s[i + k]) {
      ok = 0;
    }
  }
  string ans = s;
  for (long long i = 0; i < k; ++i) {
    for (int q = i; q < ans.length(); q += k) {
      ans[q] = s[i];
    }
  }
  for (int i = 0; i < ans.length(); ++i) {
    if (ans[i] > s[i]) {
      break;
    } else if (ans[i] < s[i]) {
      for (int q = k - 1; q >= 0; --q) {
        if (s[q] != '9') {
          s[q]++;
          for (int t = q; t < ans.length(); t += k) {
            ans[t] = s[q];
          }
          for (int t = q + 1; t < k; ++t) {
            for (int j = t; j < ans.length(); j += k) {
              ans[j] = '0';
            }
          }
          break;
        }
      }
      break;
    }
  }
  cout << ans.length() << endl;
  cout << ans << endl;
}
int main() {
  init();
  solve();
}
